結果
| 問題 |
No.129 お年玉(2)
|
| コンテスト | |
| ユーザー |
tsutaj
|
| 提出日時 | 2017-07-05 09:27:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 821 bytes |
| コンパイル時間 | 1,483 ms |
| コンパイル使用メモリ | 165,908 KB |
| 実行使用メモリ | 311,112 KB |
| 最終ジャッジ日時 | 2024-10-05 19:45:11 |
| 合計ジャッジ時間 | 14,132 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | RE * 1 TLE * 3 -- * 42 |
ソースコード
// 基本テンプレート (縮小版)
#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)--)
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;
int 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;
}
tsutaj