結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
onsen_manjuuu
|
| 提出日時 | 2020-08-29 17:41:26 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 194 ms / 2,000 ms |
| コード長 | 309 bytes |
| 記録 | |
| コンパイル時間 | 1,340 ms |
| コンパイル使用メモリ | 188,348 KB |
| 実行使用メモリ | 19,712 KB |
| 最終ジャッジ日時 | 2026-05-10 02:12:17 |
| 合計ジャッジ時間 | 3,626 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
int n, x;
cin >> n >> x;
map<int,int> mp;
vector<int> a(n);
for(int i = 0; i < n; i++)cin >> a[i];
ll sum = 0;
for(int i = 0; i < n; i++) {
int g = x ^ a[i];
sum += mp[g];
mp[a[i]]++;
}
cout << sum << endl;
}
onsen_manjuuu