結果

問題 No.1220 yukipoker
ユーザー rutilicusrutilicus
提出日時 2020-09-06 11:57:27
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 612 ms / 2,000 ms
コード長 623 bytes
コンパイル時間 13,126 ms
コンパイル使用メモリ 424,484 KB
実行使用メモリ 60,380 KB
最終ジャッジ日時 2023-08-19 13:47:36
合計ジャッジ時間 23,999 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 266 ms
52,832 KB
testcase_01 AC 263 ms
52,508 KB
testcase_02 AC 265 ms
52,728 KB
testcase_03 AC 260 ms
53,548 KB
testcase_04 AC 279 ms
52,764 KB
testcase_05 AC 265 ms
52,828 KB
testcase_06 AC 261 ms
53,028 KB
testcase_07 AC 268 ms
52,780 KB
testcase_08 AC 261 ms
52,792 KB
testcase_09 AC 261 ms
53,224 KB
testcase_10 AC 259 ms
52,748 KB
testcase_11 AC 518 ms
57,980 KB
testcase_12 AC 528 ms
58,056 KB
testcase_13 AC 595 ms
60,080 KB
testcase_14 AC 589 ms
60,012 KB
testcase_15 AC 561 ms
58,104 KB
testcase_16 AC 612 ms
57,976 KB
testcase_17 AC 504 ms
58,056 KB
testcase_18 AC 539 ms
58,260 KB
testcase_19 AC 600 ms
60,380 KB
testcase_20 AC 589 ms
60,004 KB
testcase_21 AC 270 ms
52,864 KB
testcase_22 AC 271 ms
52,912 KB
testcase_23 AC 269 ms
52,804 KB
testcase_24 AC 278 ms
52,928 KB
testcase_25 AC 278 ms
53,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:20:17: warning: 'appendln(String?): 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(if (sumLog[n] < sumLog[n - k + 1] + sumLog[k] + ln(m.toDouble()) * (k - 1).toDouble()) "Flush" else "Straight")
                ^

ソースコード

diff #

import kotlin.math.ln

fun main() {
    val builder = StringBuilder()

    // 何も分からんので解説を読む
    val maxN = 100000

    val sumLog = DoubleArray(maxN + 1)

    for (i in 1..maxN) {
        sumLog[i] = sumLog[i - 1] + ln(i.toDouble())
    }

    val q = readInputLine().toInt()

    repeat(q) {
        val (n, m, k) = readInputLine().split(" ").map { it.toInt() }

        builder.appendln(if (sumLog[n] < sumLog[n - k + 1] + sumLog[k] + ln(m.toDouble()) * (k - 1).toDouble()) "Flush" else "Straight")
    }

    print(builder.toString())
}

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