結果

問題 No.987 N×Mマス計算(基本)
ユーザー rhincodon66rhincodon66
提出日時 2020-02-14 21:34:24
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 512 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 16,305 ms
コンパイル使用メモリ 421,264 KB
実行使用メモリ 54,772 KB
最終ジャッジ日時 2023-07-28 17:32:42
合計ジャッジ時間 26,192 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 289 ms
52,984 KB
testcase_01 AC 289 ms
53,116 KB
testcase_02 AC 467 ms
54,468 KB
testcase_03 AC 330 ms
52,828 KB
testcase_04 AC 459 ms
54,508 KB
testcase_05 AC 451 ms
54,480 KB
testcase_06 AC 468 ms
54,412 KB
testcase_07 AC 346 ms
53,116 KB
testcase_08 AC 326 ms
53,064 KB
testcase_09 AC 333 ms
53,268 KB
testcase_10 AC 332 ms
53,064 KB
testcase_11 AC 476 ms
54,772 KB
testcase_12 AC 483 ms
54,524 KB
testcase_13 AC 361 ms
53,740 KB
testcase_14 AC 327 ms
53,228 KB
testcase_15 AC 357 ms
53,300 KB
testcase_16 AC 489 ms
54,504 KB
testcase_17 AC 467 ms
54,504 KB
testcase_18 AC 485 ms
54,724 KB
testcase_19 AC 512 ms
54,720 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args:Array<String>){
         ^
Main.kt:12:9: warning: variable 'ans' is never used
    val ans = Array(n){LongArray(m)}
        ^

ソースコード

diff #

import java.util.*

fun main(args:Array<String>){
    val (n,m) = readLine()!!.split(" ").map{it.toInt()}
    val tmp = readLine()!!.split(" ")
    val op = tmp[0]
    val b = tmp.drop(1).map{it.toLong()}
    val a = LongArray(n)
    for(i in 0 until n){
        a[i] = readLine()!!.toLong()
    }
    val ans = Array(n){LongArray(m)}
    for(i in 0 until n){
        for(j in 0 until m){
            if(j != 0) print(" ")
            print(if(op == "+") a[i] + b[j] else a[i] * b[j])
        }
        println()
    }
}


0