結果

問題 No.1003 サイコロの実装 (1)
ユーザー qszhuqszhu
提出日時 2022-10-05 23:02:47
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 276 ms / 2,000 ms
コード長 585 bytes
コンパイル時間 15,722 ms
コンパイル使用メモリ 413,764 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-08-30 12:42:04
合計ジャッジ時間 22,743 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 276 ms
54,336 KB
testcase_01 AC 275 ms
52,444 KB
testcase_02 AC 272 ms
52,192 KB
testcase_03 AC 271 ms
54,224 KB
testcase_04 AC 265 ms
52,380 KB
testcase_05 AC 267 ms
52,340 KB
testcase_06 AC 270 ms
52,568 KB
testcase_07 AC 265 ms
54,396 KB
testcase_08 AC 268 ms
54,340 KB
testcase_09 AC 266 ms
54,344 KB
testcase_10 AC 266 ms
52,432 KB
testcase_11 AC 263 ms
52,680 KB
testcase_12 AC 264 ms
54,320 KB
testcase_13 AC 266 ms
56,128 KB
testcase_14 AC 263 ms
54,532 KB
testcase_15 AC 264 ms
54,444 KB
testcase_16 AC 268 ms
52,880 KB
testcase_17 AC 270 ms
54,356 KB
testcase_18 AC 265 ms
52,432 KB
testcase_19 AC 265 ms
52,368 KB
testcase_20 AC 264 ms
54,364 KB
testcase_21 AC 265 ms
54,312 KB
testcase_22 AC 263 ms
52,436 KB
testcase_23 AC 263 ms
52,836 KB
testcase_24 AC 268 ms
54,404 KB
testcase_25 AC 268 ms
52,508 KB
testcase_26 AC 269 ms
54,220 KB
testcase_27 AC 266 ms
52,544 KB
権限があれば一括ダウンロードができます

ソースコード

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