結果
問題 | No.129 お年玉(2) |
ユーザー |
![]() |
提出日時 | 2015-05-13 14:25:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
MLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,342 bytes |
コンパイル時間 | 1,270 ms |
コンパイル使用メモリ | 159,416 KB |
実行使用メモリ | 635,172 KB |
最終ジャッジ日時 | 2024-10-13 09:26:33 |
合計ジャッジ時間 | 11,569 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 MLE * 16 |
ソースコード
#include<bits/stdc++.h>using namespace std;typedef long long int ll;typedef pair<int, int> pii;typedef vector<int> vi;typedef vector<pair<int, int> > vii;#define rrep(i, m, n) for(int (i)=(m); (i)<(n); (i)++)#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)#define rev(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)#define vrep(i, c) for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)#define ALL(v) (v).begin(), (v).end()#define pb push_backtemplate<class T, class S> inline pair<T, S> mp(T x, S y){ return make_pair(x, y); }template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }static const int INF = 1000000000;static const ll MOD = 1000000000LL;static const double EPS = 1E-12;const int MAX_M = 10100;ll n, m;ll dp[MAX_M+1][MAX_M+1];int main(){cin >> n >> m;n = (n - n / 1000LL / m * 1000 * m) / 1000;dp[0][0] = 1LL;erep(i, 0, m) erep(j, 0, i) dp[i+1][j+1] = (dp[i][j] + dp[i][j+1]) % MOD;cout << dp[(int)m+1][(int)n+1] << endl;return 0;}