結果
問題 | No.1220 yukipoker |
ユーザー |
![]() |
提出日時 | 2020-09-06 11:57:27 |
言語 | Kotlin (2.1.0) |
結果 |
AC
|
実行時間 | 724 ms / 2,000 ms |
コード長 | 623 bytes |
コンパイル時間 | 13,623 ms |
コンパイル使用メモリ | 437,148 KB |
実行使用メモリ | 90,688 KB |
最終ジャッジ日時 | 2024-11-29 07:00:35 |
合計ジャッジ時間 | 27,184 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
コンパイルメッセージ
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") ^
ソースコード
import kotlin.math.lnfun main() {val builder = StringBuilder()// 何も分からんので解説を読むval maxN = 100000val 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()!!}