結果

問題 No.1141 田グリッド
ユーザー renand_narirenand_nari
提出日時 2020-07-31 22:30:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 548 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 85,720 KB
最終ジャッジ日時 2023-09-21 00:55:37
合計ジャッジ時間 7,461 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,188 KB
testcase_01 AC 74 ms
71,004 KB
testcase_02 AC 71 ms
71,228 KB
testcase_03 WA -
testcase_04 AC 72 ms
71,096 KB
testcase_05 WA -
testcase_06 AC 73 ms
71,128 KB
testcase_07 AC 72 ms
71,296 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD=10**9+7
h,w=map(int, input().split())
gyou = [1]*h
retu = [1]*w
grid = []
tmp = 1

for i in range(h):
    A=[int(k) for k in input().split()]
    grid.append(A)
    for j in A:
        gyou[i] *= j % MOD
        gyou[i] %= MOD
        tmp*=j
        tmp%=MOD
    tmp%=MOD

for x in range(w):
    for y in range(h):
        retu[x] *= grid[y][x] % MOD
        retu[x] %= MOD

q = int(input())

res = []
for i in range(q):
    r,c=map(int, input().split())
    res.append(int(tmp*grid[r-1][c-1]/(gyou[r-1]*retu[c-1])))
for i in res:
    print(i)
0