結果
| 問題 | No.129 お年玉(2) |
| コンテスト | |
| ユーザー |
dnish
|
| 提出日時 | 2018-06-22 17:30:52 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 654 bytes |
| 記録 | |
| コンパイル時間 | 1,329 ms |
| コンパイル使用メモリ | 183,872 KB |
| 実行使用メモリ | 792,704 KB |
| 最終ジャッジ日時 | 2026-03-21 02:36:56 |
| 合計ジャッジ時間 | 10,974 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 MLE * 5 |
ソースコード
#include "bits/stdc++.h"
#define REP(i,n,N) for(ll i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
#define p2(a,b) cout<<(a)<<" "<<(b)<<endl
#define v2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll mod= 1e9;
ll dp[10010][10100];
int main(){
ll N, M;
cin >> N >> M;
N/=1000LL;
N%=M;
dp[0][0]=1;
REP(i,0,M){
REP(j,0,N+1){
(dp[i+1][j] += dp[i][j]) %= mod;
if(j+1<=N) (dp[i+1][j+1] += dp[i][j]) %= mod;
}
}
p(dp[M][N]);
return 0;
}
dnish