結果

問題 No.1141 田グリッド
ユーザー i524i524
提出日時 2020-08-14 14:34:14
言語 Scala(Beta)
(3.4.0)
結果
WA  
実行時間 -
コード長 739 bytes
コンパイル時間 15,966 ms
コンパイル使用メモリ 255,572 KB
実行使用メモリ 86,140 KB
最終ジャッジ日時 2024-04-18 18:35:58
合計ジャッジ時間 32,805 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 881 ms
63,496 KB
testcase_01 AC 902 ms
63,720 KB
testcase_02 AC 911 ms
63,412 KB
testcase_03 WA -
testcase_04 AC 913 ms
63,812 KB
testcase_05 AC 911 ms
63,692 KB
testcase_06 AC 895 ms
63,644 KB
testcase_07 AC 901 ms
63,596 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn.readLine

object Main {
  def MOD_NUMBER = 1000000007
  def modMultiply(x: Int, y: Int): Int = (x * y) % MOD_NUMBER
  def main(args: Array[String]): Unit = {
    val arr = readLine().split(" ").map(_.toInt)
    val h = arr(0)
    val w = arr(1)

    val numbers = 0 until h map(_ => readLine().split(" ").map(_.toInt))
    val q = readLine().toInt
    val lines = 0 until q map(_ => readLine().split(" ").map(_.toInt))

    val rowResults = numbers map(row => row.reduceLeft(_ * _))
    lines foreach {
      case Array(row, column) => {
        val result = 0 until h filter(_ != row - 1) map(i => rowResults(i) / numbers(i)(column - 1)) reduceLeft modMultiply
        System.out.println(result)
      }
    }
  }
}
0