結果
| 問題 |
No.988 N×Mマス計算(総和)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-01 01:10:30 |
| 言語 | Scala(Beta) (3.6.2) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 535 bytes |
| コンパイル時間 | 11,627 ms |
| コンパイル使用メモリ | 260,500 KB |
| 実行使用メモリ | 98,224 KB |
| 最終ジャッジ日時 | 2024-10-03 00:36:59 |
| 合計ジャッジ時間 | 27,692 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 TLE * 1 -- * 10 |
ソースコード
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)
}