結果

問題 No.1230 Hall_and_me
ユーザー rutilicusrutilicus
提出日時 2020-09-19 21:34:08
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 575 bytes
コンパイル時間 13,533 ms
コンパイル使用メモリ 423,600 KB
実行使用メモリ 53,536 KB
最終ジャッジ日時 2023-09-06 00:01:36
合計ジャッジ時間 26,067 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
52,808 KB
testcase_01 AC 290 ms
53,008 KB
testcase_02 AC 296 ms
53,204 KB
testcase_03 AC 294 ms
52,772 KB
testcase_04 AC 295 ms
53,100 KB
testcase_05 AC 296 ms
53,332 KB
testcase_06 AC 300 ms
52,804 KB
testcase_07 AC 296 ms
52,980 KB
testcase_08 AC 297 ms
52,992 KB
testcase_09 AC 304 ms
53,008 KB
testcase_10 AC 295 ms
52,812 KB
testcase_11 AC 293 ms
52,796 KB
testcase_12 AC 296 ms
53,004 KB
testcase_13 AC 289 ms
53,100 KB
testcase_14 AC 289 ms
52,844 KB
testcase_15 AC 297 ms
53,096 KB
testcase_16 AC 293 ms
53,132 KB
testcase_17 AC 296 ms
52,812 KB
testcase_18 AC 293 ms
52,896 KB
testcase_19 AC 292 ms
53,000 KB
testcase_20 AC 293 ms
52,864 KB
testcase_21 AC 294 ms
53,536 KB
testcase_22 AC 299 ms
53,008 KB
testcase_23 AC 301 ms
52,804 KB
testcase_24 AC 301 ms
52,992 KB
testcase_25 AC 295 ms
53,268 KB
testcase_26 AC 295 ms
52,948 KB
testcase_27 AC 298 ms
53,088 KB
testcase_28 AC 298 ms
52,800 KB
testcase_29 AC 296 ms
52,868 KB
testcase_30 AC 299 ms
52,808 KB
testcase_31 AC 298 ms
52,988 KB
testcase_32 AC 299 ms
52,896 KB
testcase_33 AC 297 ms
52,768 KB
testcase_34 AC 294 ms
52,856 KB
testcase_35 AC 290 ms
52,792 KB
testcase_36 AC 293 ms
53,052 KB
testcase_37 AC 291 ms
52,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:21:13: warning: 'appendln(Double): 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(ans)
            ^

ソースコード

diff #

import kotlin.math.max

fun main() {
    val builder = StringBuilder()

    // モンティホール問題らしい
    val (p, q, r) = readInputLine().split(" ").map { it.toDouble() }

    val base = p + q + r

    var ans = 0.0

    // なんか違う気がする
    ans = max(ans, p / base)
    ans = max(ans, (q + r) / base)
    ans = max(ans, q / base)
    ans = max(ans, (p + r) / base)
    ans = max(ans, r / base)
    ans = max(ans, (p + q) / base)

    builder.appendln(ans)

    print(builder.toString())
}

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