結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
Novi
|
| 提出日時 | 2020-06-06 15:08:27 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 309 ms / 2,000 ms |
| + 493µs | |
| コード長 | 281 bytes |
| 記録 | |
| コンパイル時間 | 59 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 34,372 KB |
| 最終ジャッジ日時 | 2026-10-12 19:55:40 |
| 合計ジャッジ時間 | 2,876 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
import collections
n,x=map(int,input().split())
a=[int(input()) for i in range(n)]
ans=0
tmp=collections.Counter(a)
ty=tmp.items()
if x==0:
for i,j in ty:
ans+=(j*(j-1)//2)
print(ans)
else:
for i , j in ty:
b=i^x
ans+=tmp[b]*j
print(ans//2)
Novi