結果

問題 No.1142 XOR と XOR
ユーザー mfbgjsczmfbgjscz
提出日時 2020-08-01 13:44:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 2,456 ms
コンパイル使用メモリ 201,956 KB
実行使用メモリ 4,792 KB
最終ジャッジ日時 2023-09-22 08:20:15
合計ジャッジ時間 6,440 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,356 KB
testcase_01 AC 5 ms
4,356 KB
testcase_02 AC 5 ms
4,352 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 4 ms
4,352 KB
testcase_12 AC 5 ms
4,356 KB
testcase_13 AC 5 ms
4,356 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define r(i,m,n) for(int i=m;i<n;i++)
#define m 1000000007
#define n 1024
using namespace std;int main(){int N,M,K,s=0;cin>>N>>M>>K;vector<int>P(N+1),Q(M+1),A(n),B(n),C(n),D(n);r(i,1,N+1)cin >> P[i];r(i,1,M+1)cin >> Q[i];r(i,1,N+1)P[i]^=P[i-1];r(i,1,M+1)Q[i]^=Q[i-1];r(i,0,N+1)A[P[i]]++;r(i,0,M+1)B[Q[i]]++;r(i,0,n)r(j,i,n){if(i==j){C[0]=(C[0]+A[i]*(A[i]-1)/2%m)%m;D[0]=(D[0]+B[i]*(B[i]-1)/2%m)%m;}else{C[i^j]=(C[i^j]+A[i]*A[j]%m)%m;D[i^j]=(D[i^j]+B[i]*B[j]%m)%m;}}r(i,0,n)s=(s+C[i]*D[K^i]%m)%m;cout<<s<<endl;}
0