結果

問題 No.1876 Xor of Sum
ユーザー ytqm3ytqm3
提出日時 2022-03-10 14:01:32
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 374 ms / 2,000 ms
コード長 273 bytes
コンパイル時間 2,184 ms
コンパイル使用メモリ 202,780 KB
実行使用メモリ 5,104 KB
最終ジャッジ日時 2023-10-17 03:39:37
合計ジャッジ時間 11,078 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
5,104 KB
testcase_01 AC 8 ms
5,104 KB
testcase_02 AC 10 ms
5,104 KB
testcase_03 AC 155 ms
5,104 KB
testcase_04 AC 261 ms
5,104 KB
testcase_05 AC 37 ms
5,104 KB
testcase_06 AC 367 ms
5,104 KB
testcase_07 AC 43 ms
5,104 KB
testcase_08 AC 38 ms
5,104 KB
testcase_09 AC 244 ms
5,104 KB
testcase_10 AC 131 ms
5,104 KB
testcase_11 AC 315 ms
5,104 KB
testcase_12 AC 154 ms
5,104 KB
testcase_13 AC 225 ms
5,104 KB
testcase_14 AC 190 ms
5,104 KB
testcase_15 AC 210 ms
5,104 KB
testcase_16 AC 32 ms
5,104 KB
testcase_17 AC 334 ms
5,104 KB
testcase_18 AC 374 ms
5,104 KB
testcase_19 AC 374 ms
5,104 KB
testcase_20 AC 370 ms
5,104 KB
testcase_21 AC 371 ms
5,104 KB
testcase_22 AC 371 ms
5,104 KB
testcase_23 AC 372 ms
5,104 KB
testcase_24 AC 366 ms
5,104 KB
testcase_25 AC 369 ms
5,104 KB
testcase_26 AC 369 ms
5,104 KB
testcase_27 AC 369 ms
5,104 KB
testcase_28 AC 370 ms
5,104 KB
testcase_29 AC 371 ms
5,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin>>N;
  bitset<4000005> dp(1);
  for(int i=0;i<N;++i){
    int t;
    cin>>t;
    dp^=(dp<<t);
  }
  int ans=0;
  for(int i=0;i<=4000000;++i){
    if(dp[i]){
      ans^=i;
    }
  }
  cout<<ans<<endl;
}
0