結果
| 問題 |
No.129 お年玉(2)
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-01-29 17:18:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 321 bytes |
| コンパイル時間 | 515 ms |
| コンパイル使用メモリ | 55,444 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-23 03:48:31 |
| 合計ジャッジ時間 | 6,520 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 RE * 37 |
ソースコード
#include <iostream>
using namespace std;
const int mod=1e9;
int c[3][10001];
int main()
{
int n, m;
cin>>n>>m;
n=(n-n/m/1000*m*1000)/1000;
for(int i=0;i<3;++i) c[i][0]=1;
for(int i=1;i<=m;++i) for(int j=1;j<=i;++j)
c[i%3][j]=(c[(i+2)%3][j-1]+c[(i+2)%3][j])%mod;
cout<<c[m%3][n]<<endl;
}
hogeover30