結果
| 問題 | 
                            No.2672 Subset Xor Sum
                             | 
                    
| コンテスト | |
| ユーザー | 
                             てんぷら
                         | 
                    
| 提出日時 | 2024-03-15 21:27:15 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 999 bytes | 
| コンパイル時間 | 5,302 ms | 
| コンパイル使用メモリ | 306,688 KB | 
| 実行使用メモリ | 10,496 KB | 
| 最終ジャッジ日時 | 2024-09-30 00:23:24 | 
| 合計ジャッジ時間 | 10,331 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 27 WA * 6 TLE * 1 -- * 32 | 
ソースコード
#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
using namespace std;
using namespace atcoder;
using mint = modint998244353;
const int inf = 1000000007;
const ll longinf = 1ll << 60;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int x = 0;
    rep(i, n) x ^= a[i];
    if(x) {
        cout << "No" << endl;
        return 0;
    }
    if(n > 15) {
        cout << "Yes" << endl;
    }
    int all = 1 << n;
    rep(i, all) {
        if(i == 0 || i + 1 == all)
            continue;
        int x = 0;
        rep(j, n) {
            if(i >> j & 1)
                x ^= a[j];
        }
        if(x == 0) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}
            
            
            
        
            
てんぷら