結果
問題 | No.129 お年玉(2) |
ユーザー |
![]() |
提出日時 | 2015-07-17 11:53:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
MLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 549 bytes |
コンパイル時間 | 1,021 ms |
コンパイル使用メモリ | 84,688 KB |
実行使用メモリ | 784,976 KB |
最終ジャッジ日時 | 2025-04-01 18:17:21 |
合計ジャッジ時間 | 19,525 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 3 |
other | MLE * 46 |
ソースコード
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <complex> #include <queue> #include <set> #include <map> using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) typedef long long ll; int const MOD = 1e9; ll dp[10001][10001]; int main() { ll N, M; cin >> N >> M; N /= 1000; ll R = N % M; rep(i, 10001) { dp[i][i] = dp[i][0] = 1; REP(j, 1, i) { dp[i][j] = (dp[i-1][j] + dp[i-1][j-1]) % MOD; } } cout << dp[M][R] << endl; return 0; }