結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
Novi
|
| 提出日時 | 2020-06-06 14:57:57 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 351 bytes |
| 記録 | |
| コンパイル時間 | 53 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 18,688 KB |
| 最終ジャッジ日時 | 2026-10-06 13:21:33 |
| 合計ジャッジ時間 | 6,726 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 TLE * 1 -- * 5 |
ソースコード
n,x=map(int,input().split())
a=[int(input()) for i in range(n)]
watch=set([])
ans=0
if x==0:
for i in range(n):
y=a[i]
if not y in watch:
cnt=a.count(y)
ans+=cnt*(cnt-1)//2
watch.add(y)
print(ans)
exit()
else:
for i in range(n):
b=x^a[i]
ans+=a.count(b)
print(ans//2)
Novi