結果
問題 | No.2672 Subset Xor Sum |
ユーザー |
|
提出日時 | 2024-03-15 22:22:04 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,366 bytes |
コンパイル時間 | 6,692 ms |
コンパイル使用メモリ | 446,676 KB |
実行使用メモリ | 13,792 KB |
最終ジャッジ日時 | 2024-09-30 01:45:55 |
合計ジャッジ時間 | 11,037 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 TLE * 1 -- * 36 |
ソースコード
#include "bits/stdc++.h" #include <stdio.h> #include <math.h> #include "atcoder/all" #include <float.h> #include <boost/multiprecision/cpp_int.hpp> using namespace boost::multiprecision; using namespace std; using namespace atcoder; using ll = long long; using ull = unsigned long long; using mint = modint998244353; using mint2 = modint1000000007; const double eps = 1e-9; #define REP(i, n) for (ll i = 0; i < ll(n); ++i) #define REPI(i, init, n) for (ll i = init; i < ll(n); ++i) #define REPD(i, init) for (ll i = init; i >=0; --i) #define REPDI(i, init, n) for (ll i = init; i >=n; --i) #define REPE(i, c) for (const auto& i : c) #define TCASE() ll _ttt; cin >> _ttt; while(_ttt--) using vl = vector<ll>; using vvl = vector<vl>; using vvvl = vector<vvl>; #define VL(a, n) vector<ll> a; a.assign(n, 0); #define VLI(a, n) vector<ll> a; a.assign(n, 0); for(auto& x : a) cin >> x; void yn(bool f) { std::cout << (f ? "Yes" : "No") << endl; }; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll n; cin >> n; VLI(a, n); bool ok = false; set<ll> s; REP(i, n - 1) { vector<ll> v; v.reserve(s.size() + 1); v.push_back(a[i]); REPE(e, s) { v.push_back(e ^ a[i]); } REPE(e, v) { if (e == 0) { ok = true; break; } if (s.find(e) != s.end()) { ok = true; break; } s.insert(e); } } yn(ok); }