結果

問題 No.1142 XOR と XOR
ユーザー たたき@競プロたたき@競プロ
提出日時 2023-09-15 12:01:12
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 459 ms / 2,000 ms
コード長 829 bytes
コンパイル時間 7,828 ms
コンパイル使用メモリ 304,340 KB
実行使用メモリ 5,640 KB
最終ジャッジ日時 2023-09-15 12:01:29
合計ジャッジ時間 15,631 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 459 ms
5,468 KB
testcase_04 AC 348 ms
4,944 KB
testcase_05 AC 285 ms
4,580 KB
testcase_06 AC 360 ms
5,044 KB
testcase_07 AC 419 ms
5,604 KB
testcase_08 AC 441 ms
5,480 KB
testcase_09 AC 443 ms
5,592 KB
testcase_10 AC 440 ms
5,640 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 235 ms
4,476 KB
testcase_15 AC 228 ms
4,380 KB
testcase_16 AC 20 ms
4,380 KB
testcase_17 AC 317 ms
5,120 KB
testcase_18 AC 72 ms
4,376 KB
testcase_19 AC 356 ms
5,028 KB
testcase_20 AC 230 ms
4,856 KB
testcase_21 AC 142 ms
4,380 KB
testcase_22 AC 80 ms
4,376 KB
testcase_23 AC 334 ms
4,904 KB
testcase_24 AC 377 ms
5,216 KB
testcase_25 AC 217 ms
4,536 KB
testcase_26 AC 353 ms
4,960 KB
testcase_27 AC 283 ms
4,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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+=(mint)resa[i]*resb[i^k];
  cout<<ans.val();
}
0