結果
問題 | No.129 お年玉(2) |
ユーザー |
|
提出日時 | 2017-08-18 23:43:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 74 ms / 5,000 ms |
コード長 | 505 bytes |
コンパイル時間 | 591 ms |
コンパイル使用メモリ | 54,364 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-28 00:59:27 |
合計ジャッジ時間 | 3,327 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 46 |
ソースコード
#include <iostream>#include <string>#define MAX 1000000000using namespace std;typedef long long ll;int main(void){ll n,m;cin>>n>>m;if(n<1000){cout<<1<<endl;return 0;}n/=1000;n%=m; // mCnll s1=1,s2=1; // s1/s2ll s[100001]={0};s[0]=1;s[1]=1;for(int i=2;i<=m;i++){s[i]=1;for(int j=1;j<i;j++){s[i-j]=s[i-j-1]+s[i-j];s[j]%=MAX;}s[0]=1;// for(int XX=0;XX<=n;XX++){// cout<<s[XX]<<" ";// }// cout<<endl;}cout<<s[n]%MAX<<endl;return 0;}