Submission #00144


ソースコード

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

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
test01.txt AC 11 ms 476 KB
1
test02.txt AC 11 ms 504 KB
1
test03.txt AC 14 ms 532 KB
1
test04.txt AC 15 ms 556 KB
1
test05.txt AC 11 ms 584 KB
1
test06.txt AC 11 ms 612 KB
1
test07.txt AC 13 ms 636 KB
1
test08.txt AC 11 ms 532 KB
1
test09.txt AC 14 ms 560 KB
1
test10.txt AC 12 ms 456 KB
1