結果

問題 No.987 N×Mマス計算(基本)
ユーザー 👑 yumechiyumechi
提出日時 2021-02-18 01:29:34
言語 Scala(Beta)
(3.4.0)
結果
WA  
実行時間 -
コード長 399 bytes
コンパイル時間 11,701 ms
コンパイル使用メモリ 258,380 KB
実行使用メモリ 64,396 KB
最終ジャッジ日時 2023-10-12 11:08:49
合計ジャッジ時間 34,304 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 977 ms
63,556 KB
testcase_01 AC 984 ms
63,824 KB
testcase_02 AC 1,057 ms
63,768 KB
testcase_03 AC 1,010 ms
63,576 KB
testcase_04 AC 1,030 ms
63,608 KB
testcase_05 AC 1,021 ms
64,104 KB
testcase_06 AC 1,020 ms
63,540 KB
testcase_07 AC 1,013 ms
63,884 KB
testcase_08 AC 1,004 ms
63,764 KB
testcase_09 AC 1,000 ms
63,624 KB
testcase_10 WA -
testcase_11 AC 1,031 ms
63,828 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1,001 ms
63,452 KB
testcase_15 AC 1,024 ms
63,736 KB
testcase_16 AC 1,086 ms
63,604 KB
testcase_17 WA -
testcase_18 AC 1,081 ms
64,396 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner

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.nextInt)
  val brr = Array.fill(n)(sc.nextInt)
  val opf = op match {
    case "+" => (x:Int, y:Int) => (x + y)
    case "*" => (x:Int, y:Int) => (x * y)
  }
  brr.map(b => println(arr.map(a => opf(a, b)).mkString(" ")))
}
0