結果
| 問題 |
No.129 お年玉(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-27 16:05:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 336 bytes |
| コンパイル時間 | 500 ms |
| コンパイル使用メモリ | 65,168 KB |
| 実行使用メモリ | 32,400 KB |
| 最終ジャッジ日時 | 2024-09-24 17:44:36 |
| 合計ジャッジ時間 | 92,105 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 RE * 37 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int n,m,M=1e9,a[10001][10001];
main()
{
cin>>n>>m;n/=1000;n%=m;
for(int i=0;i<=m;i++)for(int j=0;j<=i;j++)
{
if(j==0||j==i)a[i-j][j]=1;
else
{
a[i-j][j]=a[i-j][j]+(i-j-1>=0?a[i-j-1][j]-M:0)+(j-1>=0?a[i-j][j-1]-M:0);
while(a[i-j][j]<0)a[i-j][j]+=M;
}
}
cout<<a[m-n][n]<<endl;
}