結果
問題 |
No.803 Very Limited Xor Subset
|
ユーザー |
![]() |
提出日時 | 2019-03-17 20:07:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 737 bytes |
コンパイル時間 | 1,444 ms |
コンパイル使用メモリ | 168,776 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-07 18:40:33 |
合計ジャッジ時間 | 5,015 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 WA * 26 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) struct zyoken { int t, l, r; }; zyoken z[300]; //愚直な全探索☆ int main() { int n, m, x; cin >> n >> m >> x; vector<int> a(n); rep(i, n) { cin >> a[i]; } rep(i, m) { cin >> z[i].t >> z[i].l >> z[i].r; z[i].l--; z[i].r--; } int cnt = 0; rep(i, (1 << n)) { int u[20] = {}; int s = 0; rep(j, n) { if (i&(1 << j)) { s ^= a[j]; u[j] = 1; } } if (s == x) { bool f = true; rep(j, m) { int num = 0; Rep1(k, z[j].l, z[j].r) { if (i&(1 << k))num ^= 1; } if (num^z[j].t)f = false; } if (f)cnt++; } } cout << cnt << endl; return 0; }