結果
| 問題 | No.1238 選抜クラス |
| コンテスト | |
| ユーザー |
msm1993
|
| 提出日時 | 2020-10-06 11:52:05 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 5 ms / 2,000 ms |
| + 657µs | |
| コード長 | 470 bytes |
| 記録 | |
| コンパイル時間 | 994 ms |
| コンパイル使用メモリ | 180,956 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-19 05:43:49 |
| 合計ジャッジ時間 | 3,028 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)
const ULL M=1000000007;
const int Z=40001;
ULL dp[Z] = {};
ULL dpb[Z] = {};
int main() {
int N,K; cin>>N>>K;
int A[100]; rep(i,N){ cin>>A[i]; A[i]-=K; }
dp[Z/2]=1;
rep(i,N){
rep(i,Z) dpb[i]=dp[i]%M;
for(int j=100; j<Z-100; j++)
dp[j+A[i]] += dpb[j];
}
ULL ans=0;
rep(i,Z/2) ans+=dp[Z/2+i];
ans %= M;
cout<<(ans-1)<<endl;
return 0;
}
msm1993