Submission #03927


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <bits/stdc++.h>
using namespace std;
int n,p;
int memo[111][111]={0};
long long dfs(int a,int cnt);
int main(){
cin >> p >> n;
memset(memo,-1,sizeof(memo));
cout << dfs(1,1)%100005 << endl;
}
long long dfs(int a,int cnt){
if(a<=0 || cnt>n)return 0;
if(memo[a][cnt]!=-1)return memo[a][cnt];
if(cnt==n && a==p+1)return 1;
return memo[a][cnt]=(dfs(a-1,cnt+1)+dfs(a+1,cnt+1))%100005;
}

ステータス

項目 データ
問題 0410 - メロディ作り
ユーザー名 ei1435
投稿日時 2016-05-14 16:34:23
言語 C++
状態 Accepted
得点 10
ソースコード長 423 Byte
最大実行時間 29 ms
最大メモリ使用量 720 KB

セット

セット 得点 Cases
1 ALL 10 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
test01.txt AC 29 ms 476 KB
1
test02.txt AC 11 ms 664 KB
1
test03.txt AC 13 ms 720 KB
1
test04.txt AC 13 ms 648 KB
1
test05.txt AC 13 ms 700 KB
1
test06.txt AC 11 ms 632 KB
1
test07.txt AC 13 ms 560 KB
1
test08.txt AC 14 ms 616 KB
1
test09.txt AC 11 ms 552 KB
1
test10.txt AC 10 ms 604 KB
1