結果
問題 |
No.1142 XOR と XOR
|
ユーザー |
![]() |
提出日時 | 2023-09-15 11:59:52 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 823 bytes |
コンパイル時間 | 5,224 ms |
コンパイル使用メモリ | 308,444 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-02 15:26:39 |
合計ジャッジ時間 | 13,035 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 5 |
ソースコード
#include<bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using mint=modint1000000007; using ll=long long; using pp=pair<int,int>; #define sr string #define vc vector #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ int n,m,k;cin>>n>>m>>k; vc<int>a(n),b(m); int t=1<<10; rep(i,n)cin>>a[i]; rep(i,m)cin>>b[i]; auto f=[&](vc<int>v)->vc<ll>{ vc<ll>res(t,0); vc<ll>x(t,0); x[0]=1; int now=0; for(auto au:v){ now^=au; rep(i,t)res[i^now]+=x[i]; x[now]++; } return res; }; auto resa=f(a); auto resb=f(b); mint ans=0; rep(i,t)ans+=resa[i]*resb[i^k]; cout<<ans.val(); }