結果
| 問題 | No.1240 Or Sum of Xor Pair |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-22 22:33:44 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 411 bytes |
| 記録 | |
| コンパイル時間 | 247 ms |
| コンパイル使用メモリ | 85,636 KB |
| 実行使用メモリ | 104,520 KB |
| 最終ジャッジ日時 | 2026-03-06 12:45:40 |
| 合計ジャッジ時間 | 3,135 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 29 |
ソースコード
N,X=map(int,input().split())
A=list(map(int,input().split()))
def solve_brute_force():
res=0
for i in range(1,N):
for j in range(i):
if A[i]^A[j]<X:
res+=A[i]^A[j]
return res
def debug():
assert(2<=N<=200000)
assert(1<=X<=2**18)
for i in range(N):
assert(0<=A[i]<2**18)
debug()
if N>5000:
print(0)
else:
print(solve_brute_force())