結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
6,816 KB
testcase_01 AC 5 ms
6,940 KB
testcase_02 AC 5 ms
6,940 KB
testcase_03 AC 102 ms
6,940 KB
testcase_04 AC 70 ms
6,944 KB
testcase_05 AC 58 ms
6,940 KB
testcase_06 AC 74 ms
6,940 KB
testcase_07 AC 64 ms
6,944 KB
testcase_08 AC 88 ms
6,944 KB
testcase_09 AC 87 ms
6,944 KB
testcase_10 AC 89 ms
6,940 KB
testcase_11 AC 5 ms
6,940 KB
testcase_12 AC 5 ms
6,940 KB
testcase_13 AC 5 ms
6,944 KB
testcase_14 AC 49 ms
6,940 KB
testcase_15 AC 47 ms
6,940 KB
testcase_16 AC 8 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,944 KB
testcase_20 AC 48 ms
6,944 KB
testcase_21 AC 32 ms
6,940 KB
testcase_22 AC 20 ms
6,944 KB
testcase_23 AC 68 ms
6,940 KB
testcase_24 AC 78 ms
6,940 KB
testcase_25 AC 48 ms
6,940 KB
testcase_26 AC 73 ms
6,940 KB
testcase_27 AC 60 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

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<long>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