結果

問題 No.1493 隣接xor
ユーザー uzzyuzzy
提出日時 2021-05-01 00:10:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 927 bytes
コンパイル時間 3,732 ms
コンパイル使用メモリ 189,204 KB
実行使用メモリ 16,956 KB
最終ジャッジ日時 2023-09-26 09:16:44
合計ジャッジ時間 7,836 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 206 ms
16,592 KB
testcase_06 AC 212 ms
16,716 KB
testcase_07 WA -
testcase_08 AC 206 ms
16,680 KB
testcase_09 AC 213 ms
16,848 KB
testcase_10 AC 202 ms
16,652 KB
testcase_11 AC 204 ms
16,716 KB
testcase_12 WA -
testcase_13 AC 27 ms
4,376 KB
testcase_14 AC 14 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 80 ms
10,232 KB
testcase_21 AC 99 ms
11,340 KB
testcase_22 AC 63 ms
8,840 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 36 ms
6,896 KB
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O2")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	int A[200000];
	rep(i, N) cin >> A[i];

	const int mod = 1e9 + 7;
	map<int, ll> MP;

	ll kotae = 2;
	MP[0] = 1;
	int x = 0;
	rep1(i, N - 2) {
		x ^= A[i];
		ll tmp = kotae - MP[x];
		kotae = (kotae + tmp) % mod;
		MP[x] = (MP[x] + tmp) % mod;
	}
	co(kotae);

	Would you please return 0;
}
0