結果

問題 No.1220 yukipoker
ユーザー uni_pythonuni_python
提出日時 2020-09-05 17:10:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,176 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 79,560 KB
最終ジャッジ日時 2023-08-19 09:32:56
合計ジャッジ時間 4,485 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
77,152 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

"""
確率が低い方が強い役である,という前提


フラッシュ:
N枚からK枚選ぶ & スートM種
=> NCK * M

ストレート
数字の取り方はスタートが1~N-K+1,各数字の取り方M種
(N-K+1) * pow(M,K)

普通に計算したらデカすぎ,対数とる.
Sを累積和として
S[N] - S[N-K+1] - S[k] < (K-1)*M 
ならストレートの通り数が多い=>フラッシュが強い

F/S, S/F最大値の制約があるので誤差を気にしなくて済むのか


"""

def main():
    mod=10**9+7
    Q=I()
    N2=10**5 + 5
    
    A=list(range(1,N2+1))
    S=[0]*(N2+1)
    for i in range(N2):
        S[i+1]=S[i] +A[i]
        
    def calc(n,m,k):
        left = S[n] - S[n-k+1] - S[k]
        right = (k-1) * m
        
        if left < right:
            return True
        else:
            return False
    
    
    for _ in range(Q):
        N,M,K=MI()
        if calc(N,M,K):
            print("Flush")
        else:
            print("Straight")
        


main()
0