結果
問題 |
No.1876 Xor of Sum
|
ユーザー |
![]() |
提出日時 | 2022-03-13 20:06:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 375 ms / 2,000 ms |
コード長 | 419 bytes |
コンパイル時間 | 4,100 ms |
コンパイル使用メモリ | 250,880 KB |
最終ジャッジ日時 | 2025-01-28 09:24:45 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) #define Inf 1000000000000000000 int main(){ int n; cin>>n; bitset<4000001> B; B[0] = 1; rep(i,n){ int a; cin>>a; B ^= B<<a; } int ans = 0; rep(i,B.size()){ if(B[i])ans ^= i; } cout<<ans<<endl; return 0; }