結果

問題 No.1003 サイコロの実装 (1)
ユーザー qszhu
提出日時 2022-10-05 23:02:47
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 375 ms / 2,000 ms
コード長 585 bytes
コンパイル時間 13,171 ms
コンパイル使用メモリ 439,204 KB
実行使用メモリ 59,448 KB
最終ジャッジ日時 2025-01-02 01:55:03
合計ジャッジ時間 24,926 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import kotlin.system.exitProcess

val br = System.`in`.bufferedReader()

fun readLine(): String? = br.readLine()
fun readString() = readLine()!!
fun readInt() = readString().toInt()

const val MAX_STACK_SIZE: Long = 128 * 1024 * 1024

fun main() {
    val thread = Thread(null, ::run, "solve", MAX_STACK_SIZE)
    thread.setUncaughtExceptionHandler { _, e -> e.printStackTrace(); exitProcess(1) }
    thread.start()
}

fun run() {
    val N = readInt()
    output(solve(N))
}

fun solve(N: Int): Boolean = N % 6 == 0

fun output(res: Boolean) {
    println(if (res) "Yes" else "No")
}
0