結果
問題 | No.1220 yukipoker |
ユーザー |
|
提出日時 | 2020-09-05 01:21:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 199 ms / 2,000 ms |
コード長 | 739 bytes |
コンパイル時間 | 885 ms |
コンパイル使用メモリ | 105,928 KB |
最終ジャッジ日時 | 2025-01-14 06:37:44 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
#include <cmath>#include <vector>#include <iostream>#include <algorithm>#include <set>#include <iomanip>#include <numeric>#include <queue>#include <string>#include <map>#include <fstream>#include <cassert>double log_combination(const int n, const int k) {return (n + 0.5) * std::log((n + 0.5) / (n - k + 0.5)) + k * std::log((n - k + 0.5) / k) - 0.5 * std::log(std::acos(-1) * 2 * k);}int main() {int q; std::cin >> q;for (auto i = 0; i < q; ++i) {int n, m, k; std::cin >> n >> m >> k;const double flush = std::log(m) + log_combination(n, k);const double straight = std::log(n - k + 1) + k * std::log(m);if (flush < straight) {std::cout << "Flush\n";}else {std::cout << "Straight\n";}}}