結果

問題 No.1072 A Nice XOR Pair
ユーザー mmn15277198mmn15277198
提出日時 2021-04-09 06:10:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,495 bytes
コンパイル時間 1,050 ms
コンパイル使用メモリ 102,872 KB
実行使用メモリ 19,520 KB
最終ジャッジ日時 2023-09-06 15:21:26
合計ジャッジ時間 3,078 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 156 ms
13,068 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 109 ms
9,836 KB
testcase_12 AC 193 ms
19,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <iomanip>
#include <stdio.h>
#include <math.h>
#include <queue>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); i++)
#define pb push_back 
#define eb emplace_back 
#define fi first
#define se second
#define all(x) x.begin() , x.end()
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>

const static int INF = 1001001001;
const static ll LINF = 1001001001001001001LL;
const static ld PI = 3.1415926535897932384626L;
const static int MOD = int(1e9) + int(7);
//const static ll MOD = ll(1e9) + ll(7);
//const static int MOD = 998244353;
//const static int MOD = 998244353;
const static int MX = 202020;

ll gcd (ll a , ll b) { if (a < b) swap(a , b); if (a % b == 0) return b; else return gcd (b , a % b); }
ll lcm (ll a , ll b) { return (a / gcd (a , b) * b); }
int keta (ll x) { int ret = 0; while(x) { ret++; x /= 10; } return ret; }
inline int in () { int x; scanf("%d" , &x); return x; }
inline ll lin () { ll x; scanf("%lld" , &x); return x; }

/*
//memo
v.erase(unique(all(v)), v.end());
*/

int main () {
    int n = in();
    int x = in();
    vi a(n);
    map<int,int> mp;
    rep(i,n) {
       a[i] = in();
       mp[a[i]]++;
    }
    int ans = 0;
    for(auto i : mp) {
        ans += mp[i.fi] * mp[i.fi ^ x];
    }
    cout << ans/2 << endl;
    return 0;
}







0