結果

問題 No.987 N×Mマス計算(基本)
ユーザー rhincodon66rhincodon66
提出日時 2020-02-14 21:34:24
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 554 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 15,941 ms
コンパイル使用メモリ 441,984 KB
実行使用メモリ 54,996 KB
最終ジャッジ日時 2024-04-16 01:38:40
合計ジャッジ時間 24,710 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 332 ms
51,672 KB
testcase_01 AC 327 ms
51,712 KB
testcase_02 AC 540 ms
54,296 KB
testcase_03 AC 375 ms
52,328 KB
testcase_04 AC 515 ms
54,572 KB
testcase_05 AC 494 ms
54,316 KB
testcase_06 AC 526 ms
54,488 KB
testcase_07 AC 391 ms
52,364 KB
testcase_08 AC 365 ms
52,012 KB
testcase_09 AC 359 ms
52,156 KB
testcase_10 AC 353 ms
52,104 KB
testcase_11 AC 504 ms
54,428 KB
testcase_12 AC 536 ms
54,544 KB
testcase_13 AC 387 ms
52,420 KB
testcase_14 AC 351 ms
52,004 KB
testcase_15 AC 402 ms
52,372 KB
testcase_16 AC 529 ms
54,624 KB
testcase_17 AC 515 ms
54,484 KB
testcase_18 AC 536 ms
54,660 KB
testcase_19 AC 554 ms
54,996 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