Submission #04065


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<bits/stdc++.h>
using namespace std;
long long mem[105][105];
long long p,n;
long long paturn(long long nowp,long long nown);
main(){
memset(mem,-1,sizeof(mem));
cin>>p>>n;
cout<<paturn(0,0)%100005<<endl;
}
long long paturn(long long nowp,long long nown){
if(nowp<0){
return 0;
}
if(nown>=n-1){
if(nowp==p){
return 1;
}
else{
return 0;
}
}
else if(mem[nowp][nown]!=-1){
return mem[nowp][nown];
}
else{
return mem[nowp][nown]=(paturn(nowp+1,nown+1)+paturn(nowp-1,nown+1))%100005;
}
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
test01.txt AC 12 ms 476 KB
1
test02.txt AC 11 ms 500 KB
1
test03.txt AC 10 ms 392 KB
1
test04.txt AC 11 ms 544 KB
1
test05.txt AC 11 ms 564 KB
1
test06.txt AC 14 ms 456 KB
1
test07.txt AC 13 ms 480 KB
1
test08.txt AC 11 ms 500 KB
1
test09.txt AC 12 ms 520 KB
1
test10.txt AC 14 ms 540 KB
1