結果
| 問題 |
No.129 お年玉(2)
|
| コンテスト | |
| ユーザー |
ferin
|
| 提出日時 | 2017-02-13 21:13:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 842 bytes |
| コンパイル時間 | 1,523 ms |
| コンパイル使用メモリ | 157,796 KB |
| 実行使用メモリ | 433,152 KB |
| 最終ジャッジ日時 | 2024-12-29 19:10:28 |
| 合計ジャッジ時間 | 12,824 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 4 WA * 42 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;
#define FOR(i, a, n) for (int i = (int)a; i < (int)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MOD 1000000007
#define INF 1000000000
#define PI 3.14159265359
#define EPS 1e-12
ll dp[10010][10010];
int main(void)
{
ll n, m;
cin >> n >> m;
ll a = n%(m*1000)/1000;
if(a == 0) {
cout << 1 << endl;
return 0;
}
cout << a << endl;
//m人にa枚を配る
REP(i, m+1) {
REP(j, i+1) {
if(j == 0 || j == i) dp[i][j] = 1;
else dp[i][j] = (dp[i-1][j-1] + dp[i-1][j])%INF;
//cout << dp[i][j] << " ";
}
//cout << endl;
}
cout << dp[m][a]%INF << endl;
return 0;
}
ferin