結果
| 問題 |
No.1142 XOR と XOR
|
| コンテスト | |
| ユーザー |
kyoprouno
|
| 提出日時 | 2020-08-01 19:35:52 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,427 bytes |
| コンパイル時間 | 1,940 ms |
| コンパイル使用メモリ | 179,892 KB |
| 実行使用メモリ | 16,548 KB |
| 最終ジャッジ日時 | 2024-07-08 04:24:50 |
| 合計ジャッジ時間 | 5,697 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 24 |
ソースコード
#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),s(n+1),t(m+1);
vector<ll> p(1024),q(1024);
rep(i,n){
cin >> a[i];
}
rep(i,m){
cin >> b[i];
}
rep(i,n){
s[i+1]=s[i]^a[i];
}
rep(i,m){
t[i+1]=t[i]^b[i];
}
rep(i,n+1){
for(ll j=i+1;j<n+1;j++){
ll v=s[i]^s[j];
p[v]++;
}
}
rep(i,m+1){
for(ll j=i+1;j<m+1;j++){
ll v=t[i]^t[j];
q[v]++;
}
}
ll ans=0;
rep(i,1024){
rep(j,1024){
ll v=i^j;
if(k==v){
ans+=(p[i]*q[j])%mod;
ans%=mod;
}
}
}
cout << ans << endl;
return 0;
}
kyoprouno