結果

問題 No.1142 XOR と XOR
ユーザー mfbgjsczmfbgjscz
提出日時 2020-08-01 13:28:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 741 bytes
コンパイル時間 2,113 ms
コンパイル使用メモリ 200,656 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-25 16:35:21
合計ジャッジ時間 4,632 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
6,812 KB
testcase_01 AC 6 ms
6,816 KB
testcase_02 AC 6 ms
6,944 KB
testcase_03 AC 104 ms
6,940 KB
testcase_04 AC 72 ms
6,944 KB
testcase_05 AC 59 ms
6,940 KB
testcase_06 AC 73 ms
6,944 KB
testcase_07 AC 63 ms
6,944 KB
testcase_08 AC 89 ms
6,940 KB
testcase_09 AC 90 ms
6,940 KB
testcase_10 AC 86 ms
6,940 KB
testcase_11 AC 6 ms
6,940 KB
testcase_12 AC 6 ms
6,944 KB
testcase_13 AC 6 ms
6,940 KB
testcase_14 AC 48 ms
6,940 KB
testcase_15 AC 46 ms
6,944 KB
testcase_16 AC 10 ms
6,940 KB
testcase_17 AC 52 ms
6,940 KB
testcase_18 AC 15 ms
6,944 KB
testcase_19 AC 72 ms
6,940 KB
testcase_20 AC 50 ms
6,940 KB
testcase_21 AC 34 ms
6,940 KB
testcase_22 AC 21 ms
6,940 KB
testcase_23 AC 71 ms
6,940 KB
testcase_24 AC 80 ms
6,944 KB
testcase_25 AC 47 ms
6,940 KB
testcase_26 AC 73 ms
6,940 KB
testcase_27 AC 62 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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