結果

問題 No.1453 手助け
ユーザー バカらっくバカらっく
提出日時 2022-02-04 11:04:38
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 519 bytes
コンパイル時間 13,684 ms
コンパイル使用メモリ 424,096 KB
実行使用メモリ 55,212 KB
最終ジャッジ日時 2023-09-02 03:28:20
合計ジャッジ時間 22,856 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 271 ms
52,696 KB
testcase_01 AC 277 ms
53,064 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 276 ms
53,088 KB
testcase_06 WA -
testcase_07 AC 278 ms
53,048 KB
testcase_08 AC 276 ms
52,824 KB
testcase_09 AC 274 ms
53,060 KB
testcase_10 WA -
testcase_11 AC 282 ms
52,832 KB
testcase_12 WA -
testcase_13 AC 268 ms
52,848 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 272 ms
54,924 KB
testcase_17 AC 276 ms
52,796 KB
testcase_18 WA -
testcase_19 AC 283 ms
52,696 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 270 ms
52,932 KB
testcase_23 AC 271 ms
53,048 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