結果

問題 No.1210 XOR Grid
ユーザー LyricalMaestroLyricalMaestro
提出日時 2024-01-28 19:47:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 597 ms / 2,000 ms
コード長 786 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 267,580 KB
最終ジャッジ日時 2024-01-28 19:47:26
合計ジャッジ時間 13,360 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,460 KB
testcase_01 AC 33 ms
53,460 KB
testcase_02 AC 33 ms
53,460 KB
testcase_03 AC 34 ms
53,460 KB
testcase_04 AC 35 ms
53,460 KB
testcase_05 AC 35 ms
53,460 KB
testcase_06 AC 34 ms
53,460 KB
testcase_07 AC 38 ms
53,460 KB
testcase_08 AC 33 ms
53,460 KB
testcase_09 AC 33 ms
53,460 KB
testcase_10 AC 32 ms
53,460 KB
testcase_11 AC 34 ms
53,460 KB
testcase_12 AC 33 ms
53,460 KB
testcase_13 AC 35 ms
53,460 KB
testcase_14 AC 34 ms
53,460 KB
testcase_15 AC 34 ms
53,460 KB
testcase_16 AC 34 ms
53,460 KB
testcase_17 AC 34 ms
53,460 KB
testcase_18 AC 37 ms
53,460 KB
testcase_19 AC 36 ms
53,460 KB
testcase_20 AC 34 ms
53,460 KB
testcase_21 AC 33 ms
53,460 KB
testcase_22 AC 34 ms
53,460 KB
testcase_23 AC 38 ms
53,456 KB
testcase_24 AC 34 ms
53,460 KB
testcase_25 AC 375 ms
199,232 KB
testcase_26 AC 326 ms
195,540 KB
testcase_27 AC 324 ms
195,540 KB
testcase_28 AC 321 ms
196,992 KB
testcase_29 AC 105 ms
107,904 KB
testcase_30 AC 101 ms
97,728 KB
testcase_31 AC 106 ms
107,900 KB
testcase_32 AC 105 ms
106,956 KB
testcase_33 AC 35 ms
53,460 KB
testcase_34 AC 34 ms
53,460 KB
testcase_35 AC 34 ms
53,460 KB
testcase_36 AC 182 ms
188,724 KB
testcase_37 AC 175 ms
182,452 KB
testcase_38 AC 188 ms
191,924 KB
testcase_39 AC 131 ms
144,832 KB
testcase_40 AC 321 ms
259,448 KB
testcase_41 AC 333 ms
260,036 KB
testcase_42 AC 597 ms
267,580 KB
testcase_43 AC 499 ms
258,848 KB
testcase_44 AC 580 ms
267,580 KB
testcase_45 AC 573 ms
267,388 KB
testcase_46 AC 561 ms
265,508 KB
testcase_47 AC 118 ms
114,348 KB
testcase_48 AC 117 ms
114,348 KB
testcase_49 AC 41 ms
59,380 KB
testcase_50 AC 264 ms
170,560 KB
testcase_51 AC 175 ms
133,992 KB
testcase_52 AC 157 ms
127,772 KB
testcase_53 AC 153 ms
127,856 KB
testcase_54 AC 116 ms
114,344 KB
testcase_55 AC 141 ms
134,308 KB
testcase_56 AC 112 ms
110,140 KB
testcase_57 AC 138 ms
125,640 KB
testcase_58 AC 35 ms
53,460 KB
testcase_59 AC 34 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

## https://yukicoder.me/problems/no/1210

MOD = 10 ** 9 + 7

def main():
    N, M, X = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    answer = 1
    for k in range(X):
        mask = 1 << k
        a_array = [ (1 if a & mask > 0 else 0) for a in A ]
        b_array = [ (1 if b & mask > 0 else 0) for b in B ]

        a_ = 0
        for a in a_array:
            a_ ^= a
        b_ = 0
        for b in b_array:
            b_ ^= b
        if a_ != b_:
            answer *= 0
            break
        
        if N == 1 or M == 1:
            ans = 1
        else:
            ans = pow(2, (N - 1) * (M - 1), MOD)
        answer *= ans
        answer %= MOD
    print(answer)






if __name__ == "__main__":
    main()
0