結果
| 問題 | No.1220 yukipoker |
| コンテスト | |
| ユーザー |
nagiss
|
| 提出日時 | 2020-09-04 22:02:32 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 211 ms / 2,000 ms |
| コード長 | 715 bytes |
| 記録 | |
| コンパイル時間 | 351 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 37,360 KB |
| 最終ジャッジ日時 | 2026-05-21 00:00:22 |
| 合計ジャッジ時間 | 5,548 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
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()
nagiss