結果

問題 No.1240 Or Sum of Xor Pair
コンテスト
ユーザー chineristAC
提出日時 2020-08-22 23:25:41
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 613 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,188 ms
コンパイル使用メモリ 211,280 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2026-06-12 19:45:58
合計ジャッジ時間 7,159 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other WA * 12 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<random>
#include<stdio.h>
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
using P=pair<ll,ll>;

int main(){
    ll N,X;
    scanf("%lld",&N);
    scanf("%lld",&X);
    vector<ll> A(N);
    for (ll i=0;i<N;i++){
        scanf("%lld",&A[i]);
    }
    ll res=0;
    for (ll i=1;i<N;i++){
        for (ll j=0;j<i;j++){
            if ((A[i]^A[j])<X){
                res+=A[i]^A[j];
            }
        }
    }
    cout<<res<<endl;
}
0