結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
6,812 KB
testcase_01 AC 5 ms
6,812 KB
testcase_02 AC 5 ms
6,944 KB
testcase_03 AC 102 ms
6,944 KB
testcase_04 AC 69 ms
6,944 KB
testcase_05 AC 59 ms
6,944 KB
testcase_06 AC 71 ms
6,944 KB
testcase_07 AC 63 ms
6,940 KB
testcase_08 AC 85 ms
6,940 KB
testcase_09 AC 87 ms
6,940 KB
testcase_10 AC 87 ms
6,944 KB
testcase_11 AC 5 ms
6,944 KB
testcase_12 AC 5 ms
6,940 KB
testcase_13 AC 5 ms
6,940 KB
testcase_14 AC 49 ms
6,944 KB
testcase_15 AC 48 ms
6,940 KB
testcase_16 AC 9 ms
6,940 KB
testcase_17 AC 49 ms
6,940 KB
testcase_18 AC 15 ms
6,940 KB
testcase_19 AC 72 ms
6,940 KB
testcase_20 AC 48 ms
6,944 KB
testcase_21 AC 31 ms
6,940 KB
testcase_22 AC 19 ms
6,940 KB
testcase_23 AC 64 ms
6,944 KB
testcase_24 AC 74 ms
6,944 KB
testcase_25 AC 46 ms
6,944 KB
testcase_26 AC 73 ms
6,940 KB
testcase_27 AC 60 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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