結果

問題 No.1198 お菓子配り-1
ユーザー rutilicusrutilicus
提出日時 2021-02-11 18:56:45
言語 Kotlin
(2.1.0)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 12,035 ms
コンパイル使用メモリ 433,572 KB
実行使用メモリ 56,868 KB
最終ジャッジ日時 2024-07-18 07:05:44
合計ジャッジ時間 18,570 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 8 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6: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(
            ^

ソースコード

diff #

fun main() {
    val builder = StringBuilder()

    val n = readInputLine()

    builder.appendln(
        when(n) {
            "1" -> -1
            "4" -> -1
            else -> {
                if (n.takeLast(2).toInt() % 4 == 0) 1 else -1
            }
        }
    )

    print(builder.toString())
}

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