結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー HaaHaa
提出日時 2020-12-01 18:34:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 801 bytes
コンパイル時間 1,724 ms
コンパイル使用メモリ 170,832 KB
実行使用メモリ 11,488 KB
最終ジャッジ日時 2023-09-03 03:32:47
合計ジャッジ時間 36,578 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,012 KB
testcase_01 AC 2 ms
7,896 KB
testcase_02 AC 2 ms
7,980 KB
testcase_03 AC 7 ms
8,188 KB
testcase_04 AC 22 ms
7,924 KB
testcase_05 AC 9 ms
7,888 KB
testcase_06 AC 2 ms
11,488 KB
testcase_07 AC 17 ms
4,380 KB
testcase_08 AC 4 ms
7,916 KB
testcase_09 AC 16 ms
7,836 KB
testcase_10 AC 12 ms
8,004 KB
testcase_11 AC 16 ms
7,848 KB
testcase_12 AC 12 ms
7,936 KB
testcase_13 AC 8 ms
8,168 KB
testcase_14 AC 10 ms
8,032 KB
testcase_15 AC 10 ms
7,836 KB
testcase_16 AC 11 ms
8,000 KB
testcase_17 AC 4 ms
4,380 KB
testcase_18 AC 11 ms
4,380 KB
testcase_19 AC 7 ms
4,376 KB
testcase_20 AC 3 ms
4,380 KB
testcase_21 AC 7 ms
4,380 KB
testcase_22 AC 13 ms
4,380 KB
testcase_23 AC 15 ms
4,380 KB
testcase_24 AC 20 ms
4,384 KB
testcase_25 AC 3 ms
4,380 KB
testcase_26 AC 3 ms
4,376 KB
testcase_27 AC 4 ms
4,376 KB
testcase_28 AC 3 ms
4,380 KB
testcase_29 AC 3 ms
4,384 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 3 ms
4,384 KB
testcase_32 AC 4 ms
4,376 KB
testcase_33 AC 3 ms
4,380 KB
testcase_34 AC 4 ms
4,380 KB
testcase_35 AC 3 ms
4,376 KB
testcase_36 AC 3 ms
4,376 KB
testcase_37 AC 3 ms
4,376 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 2 ms
4,380 KB
testcase_40 AC 3 ms
4,380 KB
testcase_41 AC 3 ms
4,380 KB
testcase_42 AC 3 ms
4,380 KB
testcase_43 AC 3 ms
4,380 KB
testcase_44 AC 3 ms
4,376 KB
04_evil_A_01 RE -
04_evil_A_02 RE -
04_evil_A_03 RE -
04_evil_A_04 RE -
04_evil_A_05 RE -
04_evil_A_06 RE -
04_evil_A_07 RE -
04_evil_A_08 RE -
04_evil_A_09 RE -
04_evil_A_10 RE -
05_evil_B_01 RE -
05_evil_B_02 RE -
05_evil_B_03 RE -
05_evil_B_04 RE -
05_evil_B_05 RE -
05_evil_B_06 RE -
05_evil_B_07 RE -
05_evil_B_08 RE -
05_evil_B_09 RE -
05_evil_B_10 RE -
06_evil_C_01 TLE -
06_evil_C_02 TLE -
06_evil_C_03 TLE -
06_evil_C_04 TLE -
06_evil_C_05 TLE -
06_evil_C_06 TLE -
06_evil_C_07 TLE -
06_evil_C_08 TLE -
06_evil_C_09 TLE -
06_evil_C_10 AC 2 ms
8,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=998244353;
constexpr ll INF=1e18;

int main(){
	int n, k, x, y;
	cin >> n >> k >> x >> y;
	set<int> st; int a;
	REP(i,k){
		cin >> a;
		st.insert(a);
	}
	ll dp[45][1024]={0};
	dp[0][0]=1;
	REP(i,n){
		REP(j,1024){
			for(int x:st){
				for(int l=0;i+1+l<=n;l++){
					if(l%2==0)
						dp[i+1+l][j^x]=(dp[i+1+l][j^x]+dp[i][j])%MOD;
					else
						dp[i+1+l][j]=(dp[i+1+l][j]+MOD-dp[i][j])%MOD;
				}
			}
		}
	}
	ll ans=0;
	if(x>=1024){
		cout << 0 << endl;
	}
	else{
		for(int i=x;i<=min(1023,y);i++){
			ans=(ans+dp[n][i])%MOD;
		}
		cout << ans << endl;
	}
	return 0;
}
0