結果

問題 No.1072 A Nice XOR Pair
ユーザー karinohitokarinohito
提出日時 2021-09-07 00:24:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 917 bytes
コンパイル時間 1,793 ms
コンパイル使用メモリ 173,404 KB
実行使用メモリ 24,384 KB
最終ジャッジ日時 2023-08-24 13:16:48
合計ジャッジ時間 4,247 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 232 ms
15,824 KB
testcase_08 AC 78 ms
4,376 KB
testcase_09 AC 77 ms
4,376 KB
testcase_10 AC 97 ms
4,380 KB
testcase_11 AC 196 ms
10,936 KB
testcase_12 AC 318 ms
24,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using Graph = vector<vector<ll>>;
ll mod=1e9+7;
ll modPow(long long a, long long n, long long p) {
  if (n == 0) return 1; // 0乗にも対応する場合
  if (n == 1) return a % p;
  if (n % 2 == 1) return (a * modPow(a, n - 1, p)) % p;
  long long t = modPow(a, n / 2, p);
  return (t * t) % p;
}

ll stll(string S) {
    ll n = 0;
    ll k = 1;
    rep(i, S.size()) {
        n += (k * int(S[S.size() - i - 1]-'0'));
        k *= 10;
        k %= mod;
        n %= mod;
    }
    return n;
}
ll A,B,C,D,P,Q;
ll F(ll X){
  return A*X*X*X+B*X*X+C*X+D;
}
int main() {
    ll N,X;
    cin>>N>>X;
    map<ll,ll> M;
    ll an=0;
    rep(i,N){
      ll A;
      cin>>A;
      an+=M[A^X];
      M[A]++;
    }
    cout<<an<<endl;
}
0