結果

問題 No.1141 田グリッド
ユーザー tyawanmusityawanmusi
提出日時 2020-07-31 21:40:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 20,020 KB
最終ジャッジ日時 2023-09-20 22:20:40
合計ジャッジ時間 18,315 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 18 ms
7,844 KB
testcase_02 AC 17 ms
7,840 KB
testcase_03 AC 17 ms
7,900 KB
testcase_04 AC 17 ms
7,808 KB
testcase_05 AC 17 ms
7,904 KB
testcase_06 AC 16 ms
7,900 KB
testcase_07 AC 16 ms
7,864 KB
testcase_08 AC 26 ms
8,344 KB
testcase_09 AC 22 ms
8,328 KB
testcase_10 AC 27 ms
8,348 KB
testcase_11 AC 28 ms
8,684 KB
testcase_12 AC 26 ms
8,320 KB
testcase_13 AC 816 ms
16,728 KB
testcase_14 AC 948 ms
20,020 KB
testcase_15 AC 798 ms
12,328 KB
testcase_16 AC 792 ms
12,160 KB
testcase_17 AC 794 ms
12,108 KB
testcase_18 AC 735 ms
12,200 KB
testcase_19 AC 743 ms
12,148 KB
testcase_20 AC 733 ms
12,340 KB
testcase_21 AC 808 ms
12,248 KB
testcase_22 AC 797 ms
12,072 KB
testcase_23 AC 797 ms
12,328 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 #

mod=10**9+7
h,w=map(int,input().split())
a=[list(map(int,input().split()))for _ in range(h)]
rr=[1]*h
cc=[1]*w
ans=1
for i in range(h):
  for j in range(w):
    ans*=a[i][j]
    ans%=mod
    rr[i]*=a[i][j]
    rr[i]%=mod
    cc[j]*=a[i][j]
    cc[j]%=mod
for _ in range(int(input())):
  r,c=map(int,input().split())
  print((ans*pow(rr[r-1],mod-2,mod)*pow(cc[c-1],mod-2,mod)*a[r-1][c-1])%mod)
0