結果

問題 No.1004 サイコロの実装 (2)
ユーザー 👑 箱星箱星
提出日時 2020-03-06 21:30:52
言語 Kotlin
(1.9.23)
結果
RE  
実行時間 -
コード長 890 bytes
コンパイル時間 13,599 ms
コンパイル使用メモリ 429,428 KB
実行使用メモリ 55,320 KB
最終ジャッジ日時 2024-04-22 05:08:15
合計ジャッジ時間 26,943 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 341 ms
51,236 KB
testcase_01 RE -
testcase_02 AC 332 ms
51,228 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 332 ms
51,200 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:7:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:9:9: warning: variable 'a' is never used
    val a = sc.nextInt()
        ^
Main.kt:10:9: warning: variable 'b' is never used
    val b = sc.nextInt()
        ^

ソースコード

diff #

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.lang.StringBuilder
import java.util.*

fun main(args: Array<String>) {
    val sc = FastScanner(System.`in`)
    val a = sc.nextInt()
    val b = sc.nextInt()
    val x0 = sc.nextInt()
    val n = sc.nextInt()
    if (x0 % 2 == 0) {
        println("%d %d".format(n / 2, 0))
    } else {
        println("%d %d".format(0, n / 2))
    }
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}
0