Submission #68150
ソースコード
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 | #include <bits/stdc++.h> using namespace std; signed main(){ cin.tie(nullptr); ios_base::sync_with_stdio( false ); int p,n; cin>>p>>n; vector<vector< int >> dp(n,vector< int >(n+3,0)); dp[0][0]=1; for ( int i=1;i<n;i++){ dp[i][0]=dp[i-1][1]; for ( int j=1;j<=n+1;j++){ dp[i][j]=dp[i-1][j+1]+dp[i-1][j-1]; dp[i][j]%=100005; } } // for(int i=0;i<n;i++){ // for(int j=0;j<=n+3;j++){ // cout<<dp[i][j]<<' '; // } // cout<<endl; // } cout<<dp[n-1][p]<<endl; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0410 - メロディ作り |
ユーザー名 | ei2009 |
投稿日時 | 2021-08-24 10:35:02 |
言語 | C++17 |
状態 | Accepted |
得点 | 10 |
ソースコード長 | 612 Byte |
最大実行時間 | 27 ms |
最大メモリ使用量 | 604 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 10 / 10 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
test01.txt | AC | 26 ms | 604 KB |
1
|
test02.txt | AC | 14 ms | 428 KB |
1
|
test03.txt | AC | 21 ms | 384 KB |
1
|
test04.txt | AC | 25 ms | 460 KB |
1
|
test05.txt | AC | 20 ms | 520 KB |
1
|
test06.txt | AC | 27 ms | 584 KB |
1
|
test07.txt | AC | 20 ms | 524 KB |
1
|
test08.txt | AC | 21 ms | 600 KB |
1
|
test09.txt | AC | 22 ms | 420 KB |
1
|
test10.txt | AC | 16 ms | 476 KB |
1
|