結果

問題 No.1220 yukipoker
ユーザー H3PO4H3PO4
提出日時 2022-01-08 10:04:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 365 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 14,720 KB
最終ジャッジ日時 2024-04-26 19:13:18
合計ジャッジ時間 5,405 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
14,592 KB
testcase_01 AC 64 ms
14,336 KB
testcase_02 AC 69 ms
14,336 KB
testcase_03 AC 63 ms
14,464 KB
testcase_04 AC 65 ms
14,336 KB
testcase_05 AC 63 ms
14,464 KB
testcase_06 AC 66 ms
14,592 KB
testcase_07 AC 63 ms
14,592 KB
testcase_08 AC 61 ms
14,336 KB
testcase_09 AC 63 ms
14,592 KB
testcase_10 AC 64 ms
14,592 KB
testcase_11 AC 196 ms
14,720 KB
testcase_12 AC 206 ms
14,720 KB
testcase_13 AC 353 ms
14,720 KB
testcase_14 AC 344 ms
14,720 KB
testcase_15 AC 244 ms
14,720 KB
testcase_16 AC 270 ms
14,592 KB
testcase_17 AC 182 ms
14,720 KB
testcase_18 AC 215 ms
14,720 KB
testcase_19 AC 357 ms
14,720 KB
testcase_20 AC 365 ms
14,720 KB
testcase_21 AC 63 ms
14,464 KB
testcase_22 AC 63 ms
14,592 KB
testcase_23 AC 63 ms
14,464 KB
testcase_24 AC 66 ms
14,464 KB
testcase_25 AC 63 ms
14,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import log

input = sys.stdin.buffer.readline

MAX = 10 ** 5
log_factorial = [0] * (MAX + 1)
for i in range(1, MAX + 1):
    log_factorial[i] = log_factorial[i - 1] + log(i)


def solve(N, M, K):
    log_flush = log(M) + log_factorial[N] - log_factorial[K] - log_factorial[N - K]
    log_straight = log(N - K + 1) + K * log(M)
    return "Flush" if log_flush < log_straight else "Straight"


Q = int(input())
for _ in range(Q):
    print(solve(*map(int, input().split())))
0