結果
問題 |
No.8046 yukicoderの過去問
|
ユーザー |
|
提出日時 | 2020-03-09 03:32:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 334 bytes |
コンパイル時間 | 506 ms |
コンパイル使用メモリ | 31,872 KB |
実行使用メモリ | 13,640 KB |
最終ジャッジ日時 | 2024-11-07 20:31:34 |
合計ジャッジ時間 | 4,058 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 TLE * 1 -- * 2 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() | ^~~~
ソースコード
#include<cstdio> using namespace std; const int mod=1e9+7; int K,N; int dp[2<<17]; int x[1<<17]; main() { scanf("%d%d",&K,&N); for(int i=0;i<N;i++)scanf("%d",&x[i]); dp[0]=1; for(int i=1;i<=K;i++) { long now=0; for(int j=0;j<N;j++) { if(i<x[j])break; now+=dp[i-x[j]]; } dp[i]=now%mod; } printf("%d\n",dp[K]); }