結果
| 問題 |
No.8046 yukicoderの過去問
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-19 14:43:09 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 453 bytes |
| コンパイル時間 | 3,671 ms |
| コンパイル使用メモリ | 258,568 KB |
| 実行使用メモリ | 10,532 KB |
| 最終ジャッジ日時 | 2024-10-07 21:01:01 |
| 合計ジャッジ時間 | 7,131 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 TLE * 1 -- * 5 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=998244353;
const int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
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[i+j]+=tmp*flg[j];
dp[i+j]-=mod*(dp[i+j]>=mod);
}
}
cout<<dp[k]<<endl;
}