結果

問題 No.1220 yukipoker
ユーザー nagissnagiss
提出日時 2020-09-04 22:02:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 206 ms / 2,000 ms
コード長 715 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 31,748 KB
最終ジャッジ日時 2023-08-17 15:39:25
合計ジャッジ時間 3,664 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,116 KB
testcase_01 AC 38 ms
12,260 KB
testcase_02 AC 37 ms
12,116 KB
testcase_03 AC 36 ms
12,152 KB
testcase_04 AC 36 ms
12,260 KB
testcase_05 AC 37 ms
12,208 KB
testcase_06 AC 36 ms
12,152 KB
testcase_07 AC 37 ms
12,116 KB
testcase_08 AC 37 ms
12,292 KB
testcase_09 AC 36 ms
12,144 KB
testcase_10 AC 36 ms
12,264 KB
testcase_11 AC 108 ms
20,908 KB
testcase_12 AC 112 ms
21,528 KB
testcase_13 AC 197 ms
31,144 KB
testcase_14 AC 196 ms
30,696 KB
testcase_15 AC 137 ms
22,916 KB
testcase_16 AC 154 ms
24,612 KB
testcase_17 AC 102 ms
20,096 KB
testcase_18 AC 122 ms
22,296 KB
testcase_19 AC 201 ms
31,600 KB
testcase_20 AC 206 ms
31,748 KB
testcase_21 AC 36 ms
12,120 KB
testcase_22 AC 36 ms
12,136 KB
testcase_23 AC 37 ms
12,320 KB
testcase_24 AC 37 ms
12,256 KB
testcase_25 AC 37 ms
12,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import log
class Combination:
    def __init__(self, n_max):
        # O(n_max + log(mod))
        f = 0
        self.fac = fac = [f]
        for i in range(1, n_max+1):
            f += log(i)
            fac.append(f)

    def __call__(self, n, r):
        if not 0 <= r <= n: return 0
        return self.fac[n] - self.fac[r] - self.fac[n-r]

def main():
    comb = Combination(101010)
    Q = int(sys.stdin.buffer.readline())
    m = map(int, sys.stdin.buffer.read().split())
    Ans = []
    for N, M, K in zip(m, m, m):
        if comb(N, K) < log(M) * (K-1) + log(N-K+1):
            Ans.append("Flush")
        else:
            Ans.append("Straight")
    print("\n".join(Ans))

main()
0