結果
問題 | No.1072 A Nice XOR Pair |
ユーザー |
|
提出日時 | 2020-06-05 21:38:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 286 ms / 2,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 2,019 ms |
コンパイル使用メモリ | 201,344 KB |
最終ジャッジ日時 | 2025-01-10 22:17:26 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h>int main(){int N, X;while(std::cin >> N >> X){std::vector<int> A(N);for(int i = 0; i < N; ++i) std::cin >> A[i];int64_t ans = 0;std::map<int, int64_t> m;for(int i = 0; i < N; ++i){ans += m[X ^ A[i]];m[A[i]] += 1;}std::cout << ans << "\n";}return 0;}