結果
問題 |
No.1072 A Nice XOR Pair
|
ユーザー |
![]() |
提出日時 | 2020-06-05 22:42:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 590 bytes |
コンパイル時間 | 6,476 ms |
コンパイル使用メモリ | 227,124 KB |
最終ジャッジ日時 | 2025-01-10 22:46:59 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 WA * 4 |
ソースコード
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } #include <bits/stdc++.h> using namespace std; int main(){ int n,x; cin>>n>>x; int a; map<int,int> m; rep(i,n){ cin>>a; m[a]++; } int sum=0; for(auto y:m){ sum+=y.second*m[y.first^x]; m[y.first^x]=0; } cout<<sum<<endl; return 0; }