結果
問題 |
No.1876 Xor of Sum
|
ユーザー |
|
提出日時 | 2025-06-19 21:09:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,007 ms / 2,000 ms |
コード長 | 789 bytes |
コンパイル時間 | 483 ms |
コンパイル使用メモリ | 82,112 KB |
実行使用メモリ | 262,328 KB |
最終ジャッジ日時 | 2025-06-19 21:09:29 |
合計ジャッジ時間 | 15,335 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
import os,sys,random,threading from random import randint from types import GeneratorType from functools import lru_cache from bisect import bisect_left,bisect_right from collections import Counter,defaultdict,deque from itertools import accumulate,combinations,permutations from heapq import heapify,heappop,heappush from typing import Generic,Iterable,Iterator,TypeVar,Union,List from math import sqrt,log,log10,log2 from sys import stdin, stdout, setrecursionlimit input = lambda: sys.stdin.readline().rstrip("\r\n") MI = lambda :map(int,input().split()) li = lambda :list(MI()) ii = lambda :int(input()) inf=1<<60 n=ii() a=li() f=0 for x in a: tmp=(f<<x)^(1<<x) f^=tmp res=0 f=bin(f)[2:][::-1] for i in range(1,len(f)): if f[i]=="1": res^=i print(res)