Submission #63063


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def main():
n=int(input())
a=list(map(int,input().split()))
ans=0
x=1<<31
for j in range(31,-1,-1):
y=0
n=0
for j in a:
if j&x:
y+=1
else:
n+=1
ans+=x*max(y,n)
x>>=1
print(ans)
main()

ステータス

項目 データ
問題 1117 - Xor JAPAN
ユーザー名 ir_1st_vil
投稿日時 2020-08-26 22:50:53
言語 Python3
状態 Accepted
得点 10
ソースコード長 259 Byte
最大実行時間 764 ms
最大メモリ使用量 25992 KB

セット

セット 得点 Cases
1 ALL 10 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in_1.txt AC 34 ms 3376 KB
1
in_2.txt AC 363 ms 13644 KB
1
in_3.txt AC 405 ms 14364 KB
1
in_4.txt AC 176 ms 7288 KB
1
in_5.txt AC 622 ms 21160 KB
1
in_6.txt AC 764 ms 25816 KB
1
in_7.txt AC 760 ms 25856 KB
1
in_8.txt AC 738 ms 25888 KB
1
in_9.txt AC 725 ms 25408 KB
1
in_10.txt AC 739 ms 25992 KB
1
in_11.txt AC 59 ms 3804 KB
1
sample_in.txt AC 35 ms 3284 KB
1