Submission #59253
ソースコード
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #include <bits/stdc++.h> #define F first #define S second #define MP make_pair #define pb push_back #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define LCM(a, b) (a) / __gcd((a), (b)) * (b) #define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0) #define ln '\n' using namespace std; using LL = long long ; using ldouble = long double ; using P = pair< int , int >; using LP = pair<LL, LL>; static const int INF = INT_MAX; static const LL LINF = LLONG_MAX; static const int MIN = INT_MIN; static const LL LMIN = LLONG_MIN; static const int MOD = 100005; static const int SIZE = 200005; const int dx[] = {0, -1, 1, 0}; const int dy[] = {-1, 0, 0, 1}; vector<LL> Div(LL n) { vector<LL> ret; for (LL i = 1; i * i <= n; ++i) { if (n % i == 0) { ret.pb(i); if (i * i != n) ret.pb(n / i); } } sort(all(ret)); return ret; } int dp[1005][10005]; int main() { ios::sync_with_stdio( false ); cin.tie(0); int p, n; cin >> p >> n; dp[1][1] = 1; for ( int i = 2; i <= n; ++i) { for ( int j = 1; j < 10005; ++j) { dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j + 1]; dp[i][j] %= MOD; } } cout << dp[n][p + 1] << endl; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0410 - メロディ作り |
ユーザー名 | crom |
投稿日時 | 2020-05-05 03:57:16 |
言語 | C++14 |
状態 | Accepted |
得点 | 10 |
ソースコード長 | 1316 Byte |
最大実行時間 | 45 ms |
最大メモリ使用量 | 4660 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 10 / 10 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
test01.txt | AC | 45 ms | 1500 KB |
1
|
test02.txt | AC | 20 ms | 620 KB |
1
|
test03.txt | AC | 32 ms | 828 KB |
1
|
test04.txt | AC | 31 ms | 4524 KB |
1
|
test05.txt | AC | 28 ms | 4560 KB |
1
|
test06.txt | AC | 32 ms | 2160 KB |
1
|
test07.txt | AC | 25 ms | 1328 KB |
1
|
test08.txt | AC | 22 ms | 1696 KB |
1
|
test09.txt | AC | 29 ms | 4660 KB |
1
|
test10.txt | AC | 27 ms | 4572 KB |
1
|