結果

問題 No.1220 yukipoker
ユーザー donuthole
提出日時 2020-09-05 11:30:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 358 ms / 2,000 ms
コード長 905 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2024-11-28 00:10:01
合計ジャッジ時間 5,387 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
import collections
import bisect
import itertools
import decimal
import copy
from math import log2

# import numpy as np

# sys.setrecursionlimit(10 ** 6)
INF = 10 ** 20
# MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===
def main():
    logfact = [0]
    for i in range(1, 10 ** 5 + 1):
        logfact.append(logfact[-1] + math.log(i, 10))
    q = ni()
    for _ in range(q):
        n, m, k = ns()
        f = math.log(m, 10) + logfact[n] - logfact[n - k] - logfact[k]
        s = k * math.log(m, 10) + math.log(n - k + 1, 10)

        print("Straight" if s < f else "Flush")


if __name__ == '__main__':
    main()
0