結果
問題 |
No.1072 A Nice XOR Pair
|
ユーザー |
|
提出日時 | 2020-09-15 02:43:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 447 bytes |
コンパイル時間 | 934 ms |
コンパイル使用メモリ | 79,504 KB |
実行使用メモリ | 16,288 KB |
最終ジャッジ日時 | 2024-06-22 01:29:16 |
合計ジャッジ時間 | 2,374 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 WA * 2 |
ソースコード
#include<iostream> #include<unordered_map> #include<tuple> int main() { int N, X; std::cin >> N >> X; std::unordered_map<int, int> A; int ans = 0; if (X == 0) { ans -= N; } for (int i = 0; i < N; i++) { int a; std::cin >> a; A[a] += 1; } for (auto a:A) { ans += A[a.first ^ X] * a.second; } std::cout << ans / 2 << std::endl; }