結果
| 問題 |
No.129 お年玉(2)
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-01-29 17:19:27 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 321 bytes |
| コンパイル時間 | 533 ms |
| コンパイル使用メモリ | 55,000 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 03:48:38 |
| 合計ジャッジ時間 | 6,924 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 4 WA * 5 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<=n;++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