結果

問題 No.32 貯金箱の憂鬱
ユーザー rutilicusrutilicus
提出日時 2020-08-30 21:12:36
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 289 ms / 5,000 ms
コード長 446 bytes
コンパイル時間 13,951 ms
コンパイル使用メモリ 414,796 KB
実行使用メモリ 52,892 KB
最終ジャッジ日時 2023-09-30 14:00:21
合計ジャッジ時間 18,209 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 284 ms
52,892 KB
testcase_01 AC 280 ms
52,616 KB
testcase_02 AC 282 ms
52,616 KB
testcase_03 AC 286 ms
52,764 KB
testcase_04 AC 287 ms
52,504 KB
testcase_05 AC 281 ms
52,692 KB
testcase_06 AC 284 ms
52,504 KB
testcase_07 AC 286 ms
52,772 KB
testcase_08 AC 278 ms
52,804 KB
testcase_09 AC 289 ms
52,504 KB
testcase_10 AC 287 ms
52,640 KB
testcase_11 AC 281 ms
52,888 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:20:13: warning: 'appendln(Int): kotlin.text.StringBuilder /* = java.lang.StringBuilder */' is deprecated. Use appendLine instead. Note that the new method always appends the line feed character '\n' regardless of the system line separator.
    builder.appendln(ans)
            ^

ソースコード

diff #

fun main() {
    val builder = StringBuilder()

    var current = readInputLine().toInt() * 100
    current += readInputLine().toInt() * 25
    current += readInputLine().toInt() * 1

    current %= 1000

    var ans = 0

    ans += current / 100
    current %= 100

    ans += current / 25
    current %= 25

    ans += current

    builder.appendln(ans)

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}
0