結果
| 問題 |
No.8046 yukicoderの過去問
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-19 14:44:43 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 384 bytes |
| コンパイル時間 | 3,841 ms |
| コンパイル使用メモリ | 258,976 KB |
| 実行使用メモリ | 10,532 KB |
| 最終ジャッジ日時 | 2024-10-07 21:03:45 |
| 合計ジャッジ時間 | 7,154 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 TLE * 1 -- * 5 |
ソースコード
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
bool flg[100001];
int dp[100001];
int main(){
int k,n,x;
cin>>k>>n;
while(cin>>x)
flg[x]=1;
dp[0]=1;
for(int i=0;i<k;i++){
const int tmp=dp[i];
for(int j=1;j<=k-i;j++){
dp[j+i]+=tmp*flg[j];
dp[j+i]-=mod*(dp[j+i]>=mod);
}
}
cout<<dp[k]<<endl;
}