結果

問題 No.987 N×Mマス計算(基本)
ユーザー 👑 yumechiyumechi
提出日時 2021-02-18 01:31:44
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,133 ms / 2,000 ms
コード長 516 bytes
コンパイル時間 8,378 ms
コンパイル使用メモリ 257,920 KB
実行使用メモリ 63,960 KB
最終ジャッジ日時 2023-10-12 11:11:13
合計ジャッジ時間 31,005 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 994 ms
63,216 KB
testcase_01 AC 980 ms
63,896 KB
testcase_02 AC 1,067 ms
63,904 KB
testcase_03 AC 1,019 ms
63,960 KB
testcase_04 AC 1,026 ms
63,868 KB
testcase_05 AC 1,027 ms
63,784 KB
testcase_06 AC 1,026 ms
63,812 KB
testcase_07 AC 1,003 ms
63,904 KB
testcase_08 AC 989 ms
63,884 KB
testcase_09 AC 993 ms
63,444 KB
testcase_10 AC 997 ms
63,560 KB
testcase_11 AC 1,043 ms
63,600 KB
testcase_12 AC 1,125 ms
63,624 KB
testcase_13 AC 1,033 ms
63,572 KB
testcase_14 AC 1,010 ms
63,716 KB
testcase_15 AC 1,017 ms
63,712 KB
testcase_16 AC 1,100 ms
63,632 KB
testcase_17 AC 1,061 ms
63,556 KB
testcase_18 AC 1,132 ms
63,876 KB
testcase_19 AC 1,133 ms
63,764 KB
権限があれば一括ダウンロードができます

ソースコード

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 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)
  }
  brr.map(b => println(arr.map(a => opf(a, b)).mkString(" ")))
}
0