結果
問題 |
No.1072 A Nice XOR Pair
|
ユーザー |
|
提出日時 | 2020-06-26 10:55:13 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 425 bytes |
コンパイル時間 | 232 ms |
コンパイル使用メモリ | 82,068 KB |
実行使用メモリ | 155,136 KB |
最終ジャッジ日時 | 2024-07-03 22:11:41 |
合計ジャッジ時間 | 2,305 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 WA * 3 |
ソースコード
import sys from collections import Counter, defaultdict sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def solve(): N, X = map(int, rl().split()) A = [int(rl()) for _ in range(N)] counter = Counter(A) used = defaultdict(int) ans = 0 for ai in A: tgt = X ^ ai ans += counter[tgt] - used[tgt] used[ai] += 1 print(ans) if __name__ == '__main__': solve()