結果

問題 No.1142 XOR と XOR
ユーザー cn_449cn_449
提出日時 2020-07-31 22:41:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,799 bytes
コンパイル時間 1,506 ms
コンパイル使用メモリ 131,620 KB
実行使用メモリ 4,816 KB
最終ジャッジ日時 2023-09-21 01:14:36
合計ジャッジ時間 8,467 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 AC 325 ms
4,532 KB
testcase_04 AC 254 ms
4,516 KB
testcase_05 AC 208 ms
4,376 KB
testcase_06 AC 262 ms
4,376 KB
testcase_07 AC 316 ms
4,532 KB
testcase_08 AC 321 ms
4,680 KB
testcase_09 AC 322 ms
4,816 KB
testcase_10 AC 322 ms
4,644 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 16 ms
4,376 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 172 ms
4,376 KB
testcase_21 RE -
testcase_22 AC 59 ms
4,380 KB
testcase_23 RE -
testcase_24 AC 280 ms
4,376 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#define debug(x) cerr << #x << ':' << x << '\n'
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld eps = 1e-12;
constexpr ld pi = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }

constexpr ll mod = 1000000007;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);

	int n, m, k;
	cin >> n >> m >> k;
	vector<int> a(n), b(n);
	rep(i, n) cin >> a[i]; rep(i, n) cin >> b[i];
	vector<ll> x(1024), y(1024), cntx(1024), cnty(1024);
	cntx[0] = cnty[0] = 1;
	int curx = 0, cury = 0;
	rep(i, n) {
		curx ^= a[i];
		rep(j, 1024) {
			x[j] += cntx[j ^ curx];
		}
		cntx[curx]++;
	}
	rep(i, m) {
		cury ^= b[i];
		rep(j, 1024) {
			y[j] += cnty[j ^cury];
		}
		cnty[cury]++;
	}
	rep(i, 1024) x[i] %= mod, y[i] %= mod;
	ll ans = 0;
	rep(i, 1024) ans += x[i] * y[i ^ k] % mod;
	cout << ans % mod << '\n';
}
0