結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2025-12-18 16:06:50 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 143 ms / 2,000 ms |
| + 819µs | |
| コード長 | 659 bytes |
| 記録 | |
| コンパイル時間 | 71 ms |
| コンパイル使用メモリ | 81,024 KB |
| 実行使用メモリ | 114,508 KB |
| 最終ジャッジ日時 | 2026-10-12 21:04:03 |
| 合計ジャッジ時間 | 3,018 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
import sys
from collections import defaultdict
from typing import Generator, List, Tuple
def input(): return sys.stdin.readline().rstrip('\n')
def main():
n, x = map(int, input().split())
s = defaultdict(int)
ans = 0
for _ in range(n):
a = int(input())
ans += s[a ^ x]
s[a] += 1
return ans
if __name__ == '__main__':
ret = main()
def out(x):
if isinstance(x, List) or isinstance(x, Tuple):
print(*x)
else:
print(x)
if ret is None:
pass
elif isinstance(ret, Generator):
for val in ret:
out(val)
else:
out(ret)