結果

問題 No.803 Very Limited Xor Subset
ユーザー tempura_pptempura_pp
提出日時 2019-03-14 21:03:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 671 bytes
コンパイル時間 1,605 ms
コンパイル使用メモリ 165,836 KB
実行使用メモリ 5,256 KB
最終ジャッジ日時 2023-09-09 13:44:36
合計ジャッジ時間 10,503 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 4 ms
4,380 KB
testcase_04 AC 65 ms
4,376 KB
testcase_05 AC 66 ms
4,380 KB
testcase_06 AC 65 ms
4,380 KB
testcase_07 AC 64 ms
4,376 KB
testcase_08 AC 72 ms
4,380 KB
testcase_09 AC 66 ms
4,376 KB
testcase_10 AC 83 ms
4,376 KB
testcase_11 AC 86 ms
4,376 KB
testcase_12 AC 72 ms
4,376 KB
testcase_13 AC 91 ms
4,376 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 AC 1,106 ms
4,380 KB
testcase_39 AC 1,107 ms
4,380 KB
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 AC 2 ms
4,376 KB
testcase_45 AC 1 ms
4,376 KB
testcase_46 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
const ll mod=1e9+7 ;

int main(){
	int n,m,k;
	cin>>n>>m>>k;
	assert(n<=24);
	int a[n];
	rep(i,n)cin>>a[i];
	pair<int,pair<int,int>> p[m];
	rep(i,m)cin>>p[i].first>>p[i].second.first>>p[i].second.second;
	int all=1<<n;
	int ans=0;
	rep(i,all){
		int ret=0;
		rep(j,n)if((1<<j)&i)ret^=a[j];
		if(ret!=k)continue;
		bool ok=true;
		rep(j,m){
			int cnt=0;
			REP(k,p[j].second.first-1,p[j].second.second){
				if((1<<k)&i)++cnt;
			}
			if(cnt%2!=p[j].first)ok=false;
		}
		ans+=ok;
	}
	cout<<ans<<endl;
	return 0;
}
0