結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-15 02:34:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 402 bytes |
| コンパイル時間 | 565 ms |
| コンパイル使用メモリ | 71,792 KB |
| 実行使用メモリ | 19,488 KB |
| 最終ジャッジ日時 | 2024-06-22 01:28:56 |
| 合計ジャッジ時間 | 4,395 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 TLE * 1 -- * 4 |
ソースコード
#include<iostream>
#include<set>
int main() {
int N, X;
std::cin >> N >> X;
std::multiset<int> A;
int ans = 0;
if (X == 0) {
ans -= N;
}
for (int i = 0; i < N; i++) {
int a;
std::cin >> a;
A.insert(a);
}
for (auto a:A) {
ans += A.count(a ^ X);
}
std::cout << ans / 2 << std::endl;
}