結果

問題 No.188 HAPPY DAY
ユーザー rutilicusrutilicus
提出日時 2020-08-30 21:03:00
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 363 ms / 1,000 ms
コード長 546 bytes
コンパイル時間 9,224 ms
コンパイル使用メモリ 428,868 KB
実行使用メモリ 57,892 KB
最終ジャッジ日時 2024-04-27 13:17:59
合計ジャッジ時間 10,465 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 363 ms
57,892 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:21: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 #

import java.util.*

fun main() {
    val builder = StringBuilder()

    var ans = 0

    val currentDay = GregorianCalendar(2015, 0, 1)

    while (currentDay.get(Calendar.YEAR) == 2015) {
        val month = currentDay.get(Calendar.MONTH) + 1
        val day = currentDay.get(Calendar.DAY_OF_MONTH)

        if (month == day / 10 + day % 10) {
            ans++
        }

        currentDay.add(Calendar.DAY_OF_MONTH, 1)
    }

    builder.appendln(ans)

    print(builder.toString())
}

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