結果
問題 |
No.1220 yukipoker
|
ユーザー |
![]() |
提出日時 | 2020-09-05 05:34:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 631 bytes |
コンパイル時間 | 2,385 ms |
コンパイル使用メモリ | 248,176 KB |
最終ジャッジ日時 | 2025-01-14 06:57:19 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
#include <bits/extc++.h> int main() { using namespace std; cin.tie(nullptr)->sync_with_stdio(false); using num = double; constexpr int lim = 1e5; vector<num> log_fact(lim + 1); for (int i = 1; i <= lim; ++i) log_fact[i] = log(i) + log_fact[i - 1]; int q; cin >> q; while (q--) { int n, m, k; cin >> n >> m >> k; // flush: m * binom(n, k) // straight: (n - k + 1) * (m ^ k) num log_f = log(num(m)) + log_fact[n] - log_fact[k] - log_fact[n - k]; num log_s = log(num(n - k + 1)) + log(num(m)) * k; if (log_f < log_s) cout << "Flush\n"; else cout << "Straight\n"; } }