結果
問題 | No.988 N×Mマス計算(総和) |
ユーザー | 👑 yumechi |
提出日時 | 2021-03-01 01:10:30 |
言語 | Scala(Beta) (3.4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 535 bytes |
コンパイル時間 | 10,153 ms |
コンパイル使用メモリ | 273,832 KB |
実行使用メモリ | 66,376 KB |
最終ジャッジ日時 | 2024-04-14 03:23:03 |
合計ジャッジ時間 | 25,110 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 971 ms
66,080 KB |
testcase_01 | AC | 987 ms
65,872 KB |
testcase_02 | AC | 1,005 ms
66,164 KB |
testcase_03 | AC | 986 ms
66,052 KB |
testcase_04 | AC | 984 ms
66,032 KB |
testcase_05 | AC | 1,032 ms
66,304 KB |
testcase_06 | AC | 1,043 ms
66,376 KB |
testcase_07 | AC | 1,021 ms
66,012 KB |
testcase_08 | AC | 977 ms
66,040 KB |
testcase_09 | AC | 981 ms
65,968 KB |
testcase_10 | TLE | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
ソースコード
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).sum % k) }