Submission #29386


ソースコード

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
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;
const LL mod = 100005;
LL p, n;
std::vector<std::vector<LL>>memo(112, std::vector<LL>(112, -1));
LL dp(LL s, LL t)
{
if (s == 0)
{
if (t == 0) { return 1; }
return 0;
}
if (t < 0) { return 0; }
if (memo[s][t] != -1) { return memo[s][t]; }
return memo[s][t] = dp(s - 1, t - 1) + dp(s - 1, t + 1);
}
int main()
{
in >> p >> n;
out << dp(n - 1, p) << std::endl;
}

ステータス

項目 データ
問題 0410 - メロディ作り
ユーザー名 Bwambocos
投稿日時 2017-12-03 17:10:56
言語 C++17
状態 Wrong Answer
得点 0
ソースコード長 532 Byte
最大実行時間 53 ms
最大メモリ使用量 736 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
test01.txt AC 53 ms 736 KB
1
test02.txt AC 20 ms 736 KB
1
test03.txt AC 18 ms 612 KB
1
test04.txt AC 21 ms 736 KB
1
test05.txt AC 25 ms 732 KB
1
test06.txt AC 20 ms 604 KB
1
test07.txt AC 23 ms 732 KB
1
test08.txt AC 17 ms 724 KB
1
test09.txt AC 21 ms 600 KB
1
test10.txt WA 15 ms 728 KB
1