結果

問題 No.1141 田グリッド
ユーザー mkawa2mkawa2
提出日時 2021-06-17 14:37:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,043 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 11,020 KB
実行使用メモリ 23,512 KB
最終ジャッジ日時 2023-08-30 22:07:47
合計ジャッジ時間 8,863 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,364 KB
testcase_01 AC 16 ms
8,232 KB
testcase_02 AC 16 ms
8,192 KB
testcase_03 AC 16 ms
8,272 KB
testcase_04 AC 16 ms
8,308 KB
testcase_05 AC 15 ms
8,208 KB
testcase_06 AC 15 ms
8,228 KB
testcase_07 AC 16 ms
8,228 KB
testcase_08 AC 22 ms
8,540 KB
testcase_09 AC 19 ms
8,520 KB
testcase_10 AC 22 ms
8,540 KB
testcase_11 AC 20 ms
8,636 KB
testcase_12 AC 22 ms
8,580 KB
testcase_13 AC 367 ms
15,460 KB
testcase_14 AC 441 ms
23,512 KB
testcase_15 AC 191 ms
12,384 KB
testcase_16 AC 195 ms
12,108 KB
testcase_17 AC 194 ms
12,260 KB
testcase_18 AC 178 ms
12,608 KB
testcase_19 AC 173 ms
12,588 KB
testcase_20 AC 174 ms
12,588 KB
testcase_21 AC 188 ms
12,336 KB
testcase_22 AC 192 ms
12,444 KB
testcase_23 AC 190 ms
12,336 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = 10**16
# md = 998244353
md = 10**9+7

def tos(row):
    res=1
    for a in row:
        res=res*a%md
    return res

h,w=LI()
aa=LLI(h)
si=[]
sj=[]
s=1
for row in aa:
    cur=tos(row)
    s=s*cur%md
    si.append(pow(cur,md-2,md))
for col in zip(*aa):
    sj.append(pow(tos(col),md-2,md))
for _ in range(II()):
    i,j=LI1()
    ans=s*si[i]*sj[j]*aa[i][j]%md
    print(ans)
0