結果

問題 No.1876 Xor of Sum
ユーザー 沙耶花沙耶花
提出日時 2022-03-13 20:06:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 379 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 4,544 ms
コンパイル使用メモリ 263,192 KB
実行使用メモリ 5,156 KB
最終ジャッジ日時 2023-10-19 07:20:00
合計ジャッジ時間 12,660 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
5,156 KB
testcase_01 AC 8 ms
5,156 KB
testcase_02 AC 10 ms
5,156 KB
testcase_03 AC 155 ms
5,156 KB
testcase_04 AC 265 ms
5,156 KB
testcase_05 AC 39 ms
5,156 KB
testcase_06 AC 371 ms
5,156 KB
testcase_07 AC 43 ms
5,156 KB
testcase_08 AC 38 ms
5,156 KB
testcase_09 AC 250 ms
5,156 KB
testcase_10 AC 134 ms
5,156 KB
testcase_11 AC 317 ms
5,156 KB
testcase_12 AC 156 ms
5,156 KB
testcase_13 AC 229 ms
5,156 KB
testcase_14 AC 196 ms
5,156 KB
testcase_15 AC 216 ms
5,156 KB
testcase_16 AC 32 ms
5,156 KB
testcase_17 AC 335 ms
5,156 KB
testcase_18 AC 378 ms
5,156 KB
testcase_19 AC 378 ms
5,156 KB
testcase_20 AC 375 ms
5,156 KB
testcase_21 AC 379 ms
5,156 KB
testcase_22 AC 373 ms
5,156 KB
testcase_23 AC 376 ms
5,156 KB
testcase_24 AC 374 ms
5,156 KB
testcase_25 AC 376 ms
5,156 KB
testcase_26 AC 376 ms
5,156 KB
testcase_27 AC 372 ms
5,156 KB
testcase_28 AC 372 ms
5,156 KB
testcase_29 AC 375 ms
5,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0