結果

問題 No.188 HAPPY DAY
コンテスト
ユーザー rutilicus
提出日時 2020-08-30 21:03:00
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 546 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,075 ms
コンパイル使用メモリ 411,276 KB
最終ジャッジ日時 2026-05-10 13:03:33
合計ジャッジ時間 6,680 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
Main.kt:21:13: error: 'fun StringBuilder.appendln(value: Int): 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 #
raw source code

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