結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー 👑 kmjpkmjp
提出日時 2020-12-01 02:43:11
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 1,331 bytes
コンパイル時間 2,377 ms
コンパイル使用メモリ 206,420 KB
実行使用メモリ 39,648 KB
最終ジャッジ日時 2023-09-03 03:13:15
合計ジャッジ時間 38,641 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
24,200 KB
testcase_01 AC 19 ms
39,344 KB
testcase_02 AC 12 ms
27,068 KB
testcase_03 AC 71 ms
26,976 KB
testcase_04 AC 34 ms
24,400 KB
testcase_05 AC 19 ms
24,236 KB
testcase_06 AC 11 ms
27,076 KB
testcase_07 AC 27 ms
24,252 KB
testcase_08 AC 21 ms
39,408 KB
testcase_09 AC 26 ms
26,908 KB
testcase_10 AC 20 ms
24,444 KB
testcase_11 AC 24 ms
24,300 KB
testcase_12 AC 23 ms
39,472 KB
testcase_13 AC 18 ms
24,176 KB
testcase_14 AC 21 ms
24,232 KB
testcase_15 AC 19 ms
24,476 KB
testcase_16 AC 22 ms
39,648 KB
testcase_17 AC 18 ms
19,764 KB
testcase_18 AC 21 ms
19,776 KB
testcase_19 AC 16 ms
19,780 KB
testcase_20 AC 10 ms
19,828 KB
testcase_21 AC 27 ms
19,776 KB
testcase_22 AC 24 ms
19,804 KB
testcase_23 AC 28 ms
19,812 KB
testcase_24 AC 30 ms
19,868 KB
testcase_25 AC 31 ms
19,756 KB
testcase_26 AC 22 ms
19,824 KB
testcase_27 AC 24 ms
19,816 KB
testcase_28 AC 26 ms
19,756 KB
testcase_29 AC 22 ms
19,752 KB
testcase_30 AC 29 ms
19,772 KB
testcase_31 AC 39 ms
19,772 KB
testcase_32 AC 25 ms
19,948 KB
testcase_33 AC 33 ms
19,872 KB
testcase_34 AC 23 ms
19,880 KB
testcase_35 AC 25 ms
19,820 KB
testcase_36 AC 36 ms
19,748 KB
testcase_37 AC 30 ms
19,808 KB
testcase_38 AC 29 ms
19,812 KB
testcase_39 AC 45 ms
19,768 KB
testcase_40 AC 29 ms
19,752 KB
testcase_41 AC 46 ms
19,744 KB
testcase_42 AC 26 ms
19,772 KB
testcase_43 AC 27 ms
19,752 KB
testcase_44 AC 35 ms
19,956 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
9,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------


int N,K,X,Y;
set<int> S;
const ll mo=998244353;

ll from[1024][1024],fs[1024];
ll to[1024][1024];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>K>>X>>Y;
	FOR(i,K) {
		cin>>x;
		S.insert(x);
	}
	FORR(s,S) from[s][s]=1;
	FOR(i,N-1) {
		ZERO(to);
		FOR(j,1024) {
			fs[j]=0;
			FORR(s,S) fs[j]+=from[j][s];
			fs[j]%=mo;
		}
		FOR(j,1024) FORR(s,S) (to[j^s][s]+=fs[j]+mo-from[j][s])%=mo;
		swap(from,to);
	}
	
	ll ret=0;
	FOR(i,1024) if(X<=i&&i<=Y) FORR(s,S) {
		ret+=from[i][s];
	}
	
	
	
	cout<<(ret+mo)%mo<<endl;
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0