結果

問題 No.1210 XOR Grid
コンテスト
ユーザー H3PO4
提出日時 2021-12-30 16:01:27
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 324 ms / 2,000 ms
+ 288µs
コード長 309 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 43,012 KB
最終ジャッジ日時 2026-09-11 01:09:40
合計ジャッジ時間 27,051 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import numpy as np

N, M, X = map(int, input().split())
A = np.fromstring(input(), dtype=np.int64, sep=' ')
B = np.fromstring(input(), dtype=np.int64, sep=' ')
MOD = 10 ** 9 + 7
if np.bitwise_xor.reduce(A) == np.bitwise_xor.reduce(B):
    print(pow(pow(2, (N - 1) * (M - 1), MOD), X, MOD))
else:
    print(0)
0