結果

問題 No.1453 手助け
ユーザー バカらっくバカらっく
提出日時 2022-02-04 11:07:19
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 13,290 ms
コンパイル使用メモリ 420,084 KB
実行使用メモリ 53,268 KB
最終ジャッジ日時 2023-09-02 03:28:47
合計ジャッジ時間 21,914 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
53,268 KB
testcase_01 AC 294 ms
53,064 KB
testcase_02 AC 292 ms
52,912 KB
testcase_03 AC 292 ms
52,836 KB
testcase_04 AC 294 ms
53,072 KB
testcase_05 AC 300 ms
52,960 KB
testcase_06 AC 290 ms
52,920 KB
testcase_07 AC 294 ms
52,976 KB
testcase_08 AC 289 ms
52,932 KB
testcase_09 AC 290 ms
53,000 KB
testcase_10 AC 290 ms
52,900 KB
testcase_11 AC 287 ms
52,900 KB
testcase_12 AC 287 ms
52,968 KB
testcase_13 AC 287 ms
52,988 KB
testcase_14 AC 295 ms
52,860 KB
testcase_15 AC 301 ms
52,852 KB
testcase_16 AC 293 ms
52,944 KB
testcase_17 AC 299 ms
52,800 KB
testcase_18 AC 298 ms
52,920 KB
testcase_19 AC 300 ms
53,012 KB
testcase_20 AC 295 ms
52,812 KB
testcase_21 AC 297 ms
52,864 KB
testcase_22 AC 302 ms
53,076 KB
testcase_23 AC 294 ms
53,004 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val (a,b,c,d,e) = readLine()!!.split(" ").map { it.toInt() }
    val candyCount = (b-c)*a
    val candy = mutableListOf<Int>()
    if(candyCount > 0) {
        candy.add(d)
        for(i in (2..candyCount)) {
            if(i % 10 != 0) {
                candy.add(candy.last())
            } else if(e <= candy.last()) {
                candy.add(candy.last() - e)
            } else {
                candy.add(candy.last())
            }
        }
    }
    println(candy.sum())
}
0