結果

問題 No.1240 Or Sum of Xor Pair
ユーザー chineristACchineristAC
提出日時 2020-08-22 23:25:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 613 bytes
コンパイル時間 1,927 ms
コンパイル使用メモリ 200,552 KB
実行使用メモリ 9,380 KB
最終ジャッジ日時 2023-09-04 07:44:52
合計ジャッジ時間 8,267 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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