結果
| 問題 |
No.1220 yukipoker
|
| コンテスト | |
| ユーザー |
nagiss
|
| 提出日時 | 2020-09-04 22:02:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 220 ms / 2,000 ms |
| コード長 | 715 bytes |
| コンパイル時間 | 116 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 34,072 KB |
| 最終ジャッジ日時 | 2024-11-26 12:51:45 |
| 合計ジャッジ時間 | 3,715 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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