結果
問題 |
No.2658 L-R Nim
|
ユーザー |
![]() |
提出日時 | 2024-03-01 22:47:45 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,042 bytes |
コンパイル時間 | 4,612 ms |
コンパイル使用メモリ | 314,564 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-29 14:39:29 |
合計ジャッジ時間 | 7,552 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 25 WA * 23 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace std; using namespace atcoder; typedef long long ll; int op(int a, int b) { return a ^ b; } int e() { return 0; } int main() { int n, k; cin >> n >> k; vector<int> a(n); rep(i, 0, n) cin >> a[i]; map<int, int> ma; int x = 0; ma[0]++; rep(i, 0, n) { x ^= a[i]; ma[x]++; } x = 0; int ct = 0; rep(i, 0, n) { ma[x]--; ct += ma[x]; x ^= a[i]; } cerr << ct << endl; if (ct >= 2) { cout << "No" << endl; return 0; } else { cout << "Yes" << endl; } // segtree<int, op, e> st(a); // int seg = 0; // int l = 0; // int ni = 0; // rep(i, 0, n) { // if (st.prod(ni, i + 1) == 0) { // seg++; // ni = i + 1; // } // } // cerr << seg << endl; // if (seg > 1) { // cout << "No" << endl; // return 0; // } }