結果

問題 No.1210 XOR Grid
コンテスト
ユーザー ntuda
提出日時 2025-11-25 14:17:16
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 162 ms / 2,000 ms
+ 59µs
コード長 414 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 286 ms
コンパイル使用メモリ 95,852 KB
実行使用メモリ 150,016 KB
最終ジャッジ日時 2026-07-16 23:13:22
合計ジャッジ時間 10,814 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

MOD = 10 ** 9 + 7
N,M,X = map(int,input().split())
A= list(map(int,input().split()))
B = list(map(int,input().split()))
if M == 1:
    N,M = M,N
    A,B = B,A
if N == 1:
    a = A[0]
    for b in B:
        a ^= b
    if a == 0:
        print(1)
    else:
        print(0)
    exit()
t1 = 0
for a in (A+B):
    t1 ^= a
if t1 == 0:
    ans = pow(pow(pow(2,N-1,MOD),M-1,MOD),X,MOD)
    print(ans)
else:
    print(0)
0