結果

問題 No.1240 Or Sum of Xor Pair
ユーザー Kude
提出日時 2020-09-25 23:18:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 578 bytes
コンパイル時間 2,683 ms
コンパイル使用メモリ 213,996 KB
最終ジャッジ日時 2025-01-14 21:35:25
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 TLE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
using Int = long long;
const char newl = '\n';

//INSERT ABOVE HERE
const int MAX = 200000;
using uint = unsigned int;

uint a[MAX]={};

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n, x;
  cin >> n >> x;
  unsigned long long ans = 0;
  for(int i = 0; i < n; i++) cin >> a[i];
  rep(i, n) rep(j, i) {
      uint ai = a[i], aj = a[j];
      if ((ai ^ aj) < x) ans += ai | aj;
  }
  cout<<ans<<newl;
  return 0;
}
0