結果

問題 No.988 N×Mマス計算(総和)
ユーザー 👑 yumechiyumechi
提出日時 2021-03-01 01:09:18
言語 Scala(Beta)
(3.3.1)
結果
TLE  
実行時間 -
コード長 547 bytes
コンパイル時間 10,572 ms
コンパイル使用メモリ 265,560 KB
実行使用メモリ 63,784 KB
最終ジャッジ日時 2023-07-26 13:23:01
合計ジャッジ時間 26,597 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 988 ms
63,204 KB
testcase_01 AC 990 ms
63,164 KB
testcase_02 AC 1,025 ms
63,400 KB
testcase_03 AC 998 ms
63,292 KB
testcase_04 AC 993 ms
63,228 KB
testcase_05 AC 1,062 ms
63,784 KB
testcase_06 AC 1,075 ms
63,740 KB
testcase_07 AC 1,035 ms
63,448 KB
testcase_08 AC 1,000 ms
63,272 KB
testcase_09 AC 1,005 ms
63,368 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger
import java.util.Scanner
import scala.math.BigInt.javaBigInteger2bigInt

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val m = sc.nextInt
  val k = sc.nextInt
  val op = sc.next
  val arr = Array.fill(m)(sc.nextBigInteger)
  val brr = Array.fill(n)(sc.nextBigInteger)
  val opf = op match {
    case "+" => (x:BigInteger, y:BigInteger) => (x + y)
    case "*" => (x:BigInteger, y:BigInteger) => (x * y)
  }
  println(brr.map(b => arr.map(a => opf(a, b))).map(a => a.sum).sum % k)
}
0