結果

問題 No.1220 yukipoker
ユーザー MisterMister
提出日時 2020-09-04 21:51:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 700 bytes
コンパイル時間 966 ms
コンパイル使用メモリ 84,380 KB
最終ジャッジ日時 2025-01-14 05:34:41
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>

using ldouble = long double;

constexpr int N = 200000;
std::vector<ldouble> fsum;

void init() {
    fsum.resize(N);
    fsum[0] = 0;
    for (int i = 1; i < N; ++i) {
        fsum[i] = fsum[i - 1] + std::log(i);
    }
}

void solve() {
    int n, m, k;
    std::cin >> n >> m >> k;

    auto flush = fsum[n] - fsum[k] - fsum[n - k] + std::log(m);
    auto straight = std::log(n - k + 1) + std::log(m) * k;

    std::cout << (flush < straight ? "Flush" : "Straight") << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    init();

    int q;
    std::cin >> q;
    while (q--) solve();

    return 0;
}
0