結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
milanis48663220
|
| 提出日時 | 2020-06-05 21:31:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 626 bytes |
| 記録 | |
| コンパイル時間 | 1,077 ms |
| コンパイル使用メモリ | 90,872 KB |
| 実行使用メモリ | 24,064 KB |
| 最終ジャッジ日時 | 2024-12-17 13:31:27 |
| 合計ジャッジ時間 | 2,471 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 3 |
ソースコード
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int N, X;
ll ans;
map<int, ll> mp;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout << setprecision(10) << fixed;
cin >> N >> X;
for(int i = 0; i < N; i++){
int a;
cin >> a;
if(mp.count(a) == 0){
mp[a] = 1;
}else{
mp[a]++;
}
}
for(auto i : mp){
int a = i.first;
ll c = i.second;
ans += c*mp[a^X];
}
cout << ans/2 << endl;
}
milanis48663220