結果
問題 |
No.1011 Infinite Stairs
|
ユーザー |
|
提出日時 | 2020-03-24 20:17:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 320 bytes |
コンパイル時間 | 800 ms |
コンパイル使用メモリ | 64,148 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-31 15:24:20 |
合計ジャッジ時間 | 3,931 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 RE * 17 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int N,d,K; long dp[1500],mod=1e9+7; main() { cin>>N>>d>>K; dp[0]=1; for(int c=0;c<N;c++) { for(int j=K;j>=0;j--) { (dp[j+d+1]+=mod-dp[j])%=mod; (dp[j+1]+=dp[j])%=mod; dp[j]=0; } for(int j=1;j<=K;j++) { (dp[j]+=dp[j-1])%=mod; } } cout<<dp[K]<<endl; }