結果
| 問題 |
No.1142 XOR と XOR
|
| コンテスト | |
| ユーザー |
kyoprouno
|
| 提出日時 | 2020-08-01 20:15:24 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 858 ms / 2,000 ms |
| コード長 | 1,479 bytes |
| コンパイル時間 | 2,008 ms |
| コンパイル使用メモリ | 177,836 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2024-11-08 03:43:28 |
| 合計ジャッジ時間 | 15,596 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const ll INF=1e18;
const ll mod=1e9+7;
const double eps=0.000000001;
int main(){
ll n,m,k;
cin >> n >> m >> k;
vector<ll> a(n),b(m);
vector<ll> p(1024),q(1024),x(1024),y(1024);
rep(i,n){
cin >> a[i];
}
rep(i,m){
cin >> b[i];
}
ll s=0;
p[s]=1;
rep(i,n){
s=s^a[i];
rep(j,1024){
ll val=s^j;
x[val]+=p[j];
x[val]%=mod;
}
p[s]++;
}
ll t=0;
q[t]=1;
rep(i,m){
t=t^b[i];
rep(j,1024){
ll val=t^j;
y[val]+=q[j];
y[val]%=mod;
}
q[t]++;
}
ll ans=0;
rep(i,1024){
rep(j,1024){
ll v=i^j;
if(k==v){
ans+=(x[i]*y[j])%mod;
ans%=mod;
}
}
}
cout << ans << endl;
return 0;
}
kyoprouno