結果
問題 |
No.129 お年玉(2)
|
ユーザー |
|
提出日時 | 2025-01-28 14:47:30 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 889 bytes |
コンパイル時間 | 4,391 ms |
コンパイル使用メモリ | 316,212 KB |
実行使用メモリ | 785,024 KB |
最終ジャッジ日時 | 2025-01-28 14:47:58 |
合計ジャッジ時間 | 23,208 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 MLE * 17 |
ソースコード
typedef long long ll; typedef long double ld; #include <bits/stdc++.h> using namespace std; // #define int long long #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template<typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>; // std::cout << *s.find_by_order(1) << std::endl; // 2 const ll MOD = 1000000000; signed main(){ // これがないと落ちることがある ios_base::sync_with_stdio(false); cin.tie(0); ll n; cin >> n; ll m; cin >> m; n-=n%1000; n/=1000; vector<vector<ll>> dp(m+1, vector<ll>(m+1)); dp[0][0]++; for (ll i = 0; i < m; i++){ for (ll j = 0; j <= m; j++){ dp[i+1][j] += dp[i][j]; if(j-1>=0)dp[i+1][j] += dp[i][j-1]; dp[i+1][j] %= MOD; } } cout << dp[m][n%m] << endl; }