結果
問題 |
No.130 XOR Minimax
|
ユーザー |
![]() |
提出日時 | 2023-06-19 00:25:40 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 215 bytes |
コンパイル時間 | 685 ms |
コンパイル使用メモリ | 82,256 KB |
実行使用メモリ | 86,752 KB |
最終ジャッジ日時 | 2024-06-26 10:47:54 |
合計ジャッジ時間 | 2,970 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 WA * 19 |
ソースコード
N = int(input()) A = list(map(int, input().split())) ans = 0 for i in range(35): cnt = 0 for j in range(N): if (A[j] >> i) & 1: cnt += 1 ans += min(cnt, N - cnt) * (1 << i) print(ans)