結果

問題 No.988 N×Mマス計算(総和)
ユーザー yumechiyumechi
提出日時 2021-03-01 01:09:18
言語 Scala(Beta)
(3.4.0)
結果
TLE  
実行時間 -
コード長 547 bytes
コンパイル時間 11,197 ms
コンパイル使用メモリ 268,984 KB
実行使用メモリ 66,468 KB
最終ジャッジ日時 2024-04-14 03:22:36
合計ジャッジ時間 26,517 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 991 ms
65,948 KB
testcase_01 AC 991 ms
65,796 KB
testcase_02 AC 1,037 ms
65,924 KB
testcase_03 AC 1,002 ms
66,148 KB
testcase_04 AC 991 ms
66,116 KB
testcase_05 AC 1,061 ms
66,372 KB
testcase_06 AC 1,086 ms
66,468 KB
testcase_07 AC 1,045 ms
66,096 KB
testcase_08 AC 993 ms
66,052 KB
testcase_09 AC 995 ms
65,844 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