結果

問題 No.988 N×Mマス計算(総和)
ユーザー 👑 yumechiyumechi
提出日時 2021-03-01 01:11:40
言語 Scala(Beta)
(3.4.0)
結果
TLE  
実行時間 -
コード長 539 bytes
コンパイル時間 11,362 ms
コンパイル使用メモリ 272,080 KB
実行使用メモリ 99,752 KB
最終ジャッジ日時 2024-04-14 03:23:46
合計ジャッジ時間 27,232 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,074 ms
72,864 KB
testcase_01 AC 1,046 ms
65,864 KB
testcase_02 AC 1,056 ms
66,276 KB
testcase_03 AC 1,060 ms
66,148 KB
testcase_04 AC 1,119 ms
66,092 KB
testcase_05 AC 1,161 ms
66,336 KB
testcase_06 AC 1,137 ms
66,464 KB
testcase_07 AC 1,111 ms
66,000 KB
testcase_08 AC 1,084 ms
66,060 KB
testcase_09 AC 1,056 ms
65,828 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)).sum % k).sum % k)
}
0