結果
問題 | No.1072 A Nice XOR Pair |
ユーザー |
![]() |
提出日時 | 2021-01-20 15:15:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 249 ms / 2,000 ms |
コード長 | 285 bytes |
コンパイル時間 | 403 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 112,212 KB |
最終ジャッジ日時 | 2024-12-23 04:08:44 |
合計ジャッジ時間 | 3,129 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
import collectionsN,X = map(int,input().split())L = []for i in range(N):L.append(int(input()))CL = collections.Counter(L)ans = 0if X!=0:for k,v in CL.items():ans += v * CL[k^X]ans = ans//2else:for k,v in CL.items():ans += v * (v-1) //2print(ans)