結果

問題 No.1456 Range Xor
ユーザー chocoruskchocorusk
提出日時 2021-03-31 21:20:18
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 1,017 bytes
コンパイル時間 3,508 ms
コンパイル使用メモリ 194,764 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2023-08-21 22:34:00
合計ジャッジ時間 9,575 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 144 ms
13,560 KB
testcase_04 AC 141 ms
13,572 KB
testcase_05 AC 141 ms
13,692 KB
testcase_06 AC 144 ms
13,728 KB
testcase_07 AC 140 ms
13,608 KB
testcase_08 AC 145 ms
13,564 KB
testcase_09 AC 143 ms
13,564 KB
testcase_10 AC 146 ms
13,760 KB
testcase_11 AC 18 ms
5,400 KB
testcase_12 AC 9 ms
4,380 KB
testcase_13 AC 34 ms
6,600 KB
testcase_14 AC 33 ms
6,688 KB
testcase_15 AC 111 ms
11,904 KB
testcase_16 AC 100 ms
11,380 KB
testcase_17 AC 47 ms
7,804 KB
testcase_18 AC 32 ms
6,440 KB
testcase_19 AC 72 ms
9,580 KB
testcase_20 AC 93 ms
11,320 KB
testcase_21 AC 69 ms
9,572 KB
testcase_22 AC 75 ms
9,808 KB
testcase_23 AC 37 ms
6,876 KB
testcase_24 AC 14 ms
4,856 KB
testcase_25 AC 29 ms
6,204 KB
testcase_26 AC 57 ms
8,428 KB
testcase_27 AC 88 ms
10,372 KB
testcase_28 AC 26 ms
5,952 KB
testcase_29 AC 116 ms
12,624 KB
testcase_30 AC 129 ms
13,040 KB
testcase_31 AC 22 ms
5,616 KB
testcase_32 AC 20 ms
5,428 KB
testcase_33 AC 42 ms
7,328 KB
testcase_34 AC 126 ms
12,912 KB
testcase_35 AC 57 ms
8,428 KB
testcase_36 AC 145 ms
13,368 KB
testcase_37 AC 113 ms
12,120 KB
testcase_38 AC 15 ms
4,920 KB
testcase_39 AC 91 ms
10,796 KB
testcase_40 AC 89 ms
10,604 KB
testcase_41 AC 3 ms
4,380 KB
testcase_42 AC 11 ms
4,460 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 1 ms
4,380 KB
testcase_45 AC 1 ms
4,376 KB
testcase_46 AC 1 ms
4,376 KB
testcase_47 AC 2 ms
4,384 KB
testcase_48 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    int n; cin>>n;
    int k; cin>>k;
    int a[100010];
    for(int i=0; i<n; i++) cin>>a[i];
    int s[100010]; s[0]=0;
    for(int i=0; i<n; i++) s[i+1]=(s[i]^a[i]);
    map<int, int> mp;
    for(int i=0; i<=n; i++){
        mp[s[i]]++;
    }
    ll ans=0;
    for(int i=0; i<=n; i++) ans+=mp[s[i]^k];
    if(k==0) ans-=n+1;
    if(ans>0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}
0