結果

問題 No.1072 A Nice XOR Pair
ユーザー ate
提出日時 2020-07-08 14:34:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 536 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 1,192 ms
コンパイル使用メモリ 77,692 KB
最終ジャッジ日時 2025-01-11 16:55:42
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
signed main(){
  int n,x;
  std::cin>>n>>x;
  std::map<int,int> mp;
  int64_t ans = 0;
  while(n--){
    int a;
    std::cin>>a;
    ans += mp[a^x];
    mp[a]++;
  }
  std::cout<< ans <<std::endl;
}
0