結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
trineutron
|
| 提出日時 | 2020-06-05 21:47:09 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 328 ms / 2,000 ms |
| コード長 | 375 bytes |
| 記録 | |
| コンパイル時間 | 1,272 ms |
| コンパイル使用メモリ | 218,604 KB |
| 実行使用メモリ | 35,712 KB |
| 最終ジャッジ日時 | 2026-06-10 12:58:45 |
| 合計ジャッジ時間 | 3,167 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x;
cin >> n >> x;
map<int, int64_t> a, b;
for (int i = 0; i < n; i++) {
int k;
cin >> k;
a[k]++;
b[k ^ x]++;
}
int64_t ans = 0;
for (auto x : a) {
ans += x.second * b[x.first];
}
if (x == 0) ans -= n;
cout << ans / 2 << endl;
}
trineutron