結果

問題 No.1456 Range Xor
ユーザー e869120e869120
提出日時 2021-03-31 21:12:33
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 1,003 ms
コンパイル使用メモリ 89,968 KB
実行使用メモリ 15,168 KB
最終ジャッジ日時 2023-08-21 22:02:44
合計ジャッジ時間 5,253 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 47 ms
5,740 KB
testcase_04 AC 55 ms
6,992 KB
testcase_05 AC 92 ms
11,444 KB
testcase_06 AC 47 ms
5,792 KB
testcase_07 AC 115 ms
13,308 KB
testcase_08 AC 79 ms
10,100 KB
testcase_09 AC 49 ms
6,088 KB
testcase_10 AC 59 ms
8,076 KB
testcase_11 AC 20 ms
5,732 KB
testcase_12 AC 8 ms
4,380 KB
testcase_13 AC 37 ms
7,508 KB
testcase_14 AC 21 ms
5,176 KB
testcase_15 AC 37 ms
5,012 KB
testcase_16 AC 55 ms
8,004 KB
testcase_17 AC 52 ms
9,040 KB
testcase_18 AC 16 ms
4,380 KB
testcase_19 AC 59 ms
9,324 KB
testcase_20 AC 57 ms
8,660 KB
testcase_21 AC 39 ms
6,844 KB
testcase_22 AC 31 ms
5,252 KB
testcase_23 AC 34 ms
7,064 KB
testcase_24 AC 16 ms
5,224 KB
testcase_25 AC 32 ms
6,952 KB
testcase_26 AC 62 ms
9,672 KB
testcase_27 AC 51 ms
8,056 KB
testcase_28 AC 26 ms
6,532 KB
testcase_29 AC 126 ms
15,168 KB
testcase_30 AC 66 ms
8,696 KB
testcase_31 AC 24 ms
6,256 KB
testcase_32 AC 22 ms
5,756 KB
testcase_33 AC 37 ms
6,972 KB
testcase_34 AC 77 ms
10,612 KB
testcase_35 AC 45 ms
8,012 KB
testcase_36 AC 66 ms
8,864 KB
testcase_37 AC 129 ms
14,712 KB
testcase_38 AC 16 ms
5,500 KB
testcase_39 AC 42 ms
6,376 KB
testcase_40 AC 85 ms
11,448 KB
testcase_41 AC 3 ms
4,380 KB
testcase_42 AC 12 ms
4,772 KB
testcase_43 AC 1 ms
4,380 KB
testcase_44 AC 1 ms
4,380 KB
testcase_45 AC 2 ms
4,380 KB
testcase_46 AC 1 ms
4,376 KB
testcase_47 AC 2 ms
4,376 KB
testcase_48 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
#pragma warning (disable: 4996)

long long N, X;
long long A[1 << 18];
map<long long, int> Map;

int main() {
	cin >> N >> X;
	for (int i = 1; i <= N; i++) cin >> A[i];
	for (int i = 1; i <= N; i++) A[i] ^= A[i - 1];

	Map[0] = 1;
	for (int i = 1; i <= N; i++) {
		if (Map[A[i] ^ X] == 1) {
			cout << "Yes" << endl;
			return 0;
		}
		Map[A[i]] = 1;
	}
	cout << "No" << endl;
	return 0;
}
0