結果

問題 No.143 豆
ユーザー da_louisda_louis
提出日時 2020-02-07 00:44:11
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 318 ms / 1,000 ms
コード長 275 bytes
コンパイル時間 15,899 ms
コンパイル使用メモリ 419,820 KB
実行使用メモリ 52,996 KB
最終ジャッジ日時 2023-09-30 17:45:59
合計ジャッジ時間 22,589 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 307 ms
52,832 KB
testcase_01 AC 310 ms
52,716 KB
testcase_02 AC 301 ms
52,584 KB
testcase_03 AC 304 ms
52,612 KB
testcase_04 AC 301 ms
52,908 KB
testcase_05 AC 304 ms
52,616 KB
testcase_06 AC 306 ms
52,660 KB
testcase_07 AC 312 ms
52,804 KB
testcase_08 AC 303 ms
52,864 KB
testcase_09 AC 318 ms
52,996 KB
testcase_10 AC 303 ms
52,964 KB
testcase_11 AC 302 ms
52,592 KB
testcase_12 AC 305 ms
52,580 KB
testcase_13 AC 307 ms
52,860 KB
testcase_14 AC 309 ms
52,988 KB
testcase_15 AC 307 ms
52,860 KB
testcase_16 AC 302 ms
52,920 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:6:16: warning: variable 'f' is never used
    val (k, n, f) = readLine()!!.split(' ').map { it.toInt() }
               ^

ソースコード

diff #

fun main(args: Array<String>) {
    p361()
}

fun p361() {
    val (k, n, f) = readLine()!!.split(' ').map { it.toInt() }
    val aList = readLine()!!.split(' ').map { it.toInt() }

    val answer = (k * n - aList.sum()).let { if (it < 0) -1 else it }

    println(answer)
}
0