結果
問題 | No.129 お年玉(2) |
ユーザー |
![]() |
提出日時 | 2017-07-05 09:26:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 842 bytes |
コンパイル時間 | 1,689 ms |
コンパイル使用メモリ | 167,696 KB |
実行使用メモリ | 613,196 KB |
最終ジャッジ日時 | 2024-12-01 13:41:38 |
合計ジャッジ時間 | 21,511 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 3 |
other | MLE * 46 |
ソースコード
// 基本テンプレート (縮小版) #include <bits/stdc++.h> using namespace std; #define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++) #define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++) #define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--) #define int long long template<typename T> void chmax(T &a, T b) {a = max(a, b);} template<typename T> void chmin(T &a, T b) {a = min(a, b);} template<typename T> void chadd(T &a, T b) {a = a + b;} typedef pair<int, int> pii; typedef long long ll; constexpr ll INF = 1001001001001001LL; constexpr ll MOD = 1000000000LL; ll comb[10001][10001]; signed main() { rep(i,0,10001) comb[i][0] = 1; rep(i,1,10001) repq(j,1,i) { comb[i][j] = (comb[i-1][j-1] + comb[i-1][j]) % MOD; } int N, M; cin >> N >> M; N /= 1000; N %= M; cout << comb[M][N] << endl; return 0; }