Submission #00136


ソースコード

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;
int memo[102][102];
int slv(int m,int cnt);
main(){
cin>>p>>n;
memset(memo,-1,sizeof(memo));
cout<<slv(0,1)%100005<<endl;
}
int 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]=abs(slv(m+1,cnt+1))+abs(slv(m-1,cnt+1));
return memo[m][cnt];
}

ステータス

項目 データ
問題 0006 - メロディ作り
ユーザー名 ei1541
投稿日時 2016-05-14 15:55:12
言語 C++11
状態 Wrong Answer
得点 0
ソースコード長 414 Byte
最大実行時間 13 ms
最大メモリ使用量 608 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
test01.txt AC 12 ms 476 KB
1
test02.txt AC 13 ms 416 KB
1
test03.txt AC 13 ms 480 KB
1
test04.txt AC 12 ms 412 KB
1
test05.txt AC 12 ms 480 KB
1
test06.txt AC 10 ms 544 KB
1
test07.txt AC 13 ms 608 KB
1
test08.txt AC 12 ms 548 KB
1
test09.txt AC 12 ms 488 KB
1
test10.txt WA 11 ms 552 KB
1