結果

問題 No.1220 yukipoker
ユーザー MisterMister
提出日時 2020-09-04 21:51:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 700 bytes
コンパイル時間 803 ms
コンパイル使用メモリ 83,484 KB
実行使用メモリ 6,320 KB
最終ジャッジ日時 2023-08-17 15:31:06
合計ジャッジ時間 2,476 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
6,208 KB
testcase_01 AC 7 ms
6,004 KB
testcase_02 AC 7 ms
6,216 KB
testcase_03 AC 8 ms
6,152 KB
testcase_04 AC 7 ms
6,192 KB
testcase_05 AC 7 ms
5,984 KB
testcase_06 AC 7 ms
6,196 KB
testcase_07 AC 6 ms
6,032 KB
testcase_08 AC 8 ms
6,320 KB
testcase_09 AC 7 ms
6,176 KB
testcase_10 AC 7 ms
6,076 KB
testcase_11 AC 23 ms
6,076 KB
testcase_12 AC 24 ms
6,036 KB
testcase_13 AC 42 ms
6,160 KB
testcase_14 AC 42 ms
6,028 KB
testcase_15 AC 30 ms
6,228 KB
testcase_16 AC 32 ms
6,212 KB
testcase_17 AC 21 ms
6,260 KB
testcase_18 AC 26 ms
6,252 KB
testcase_19 AC 42 ms
6,172 KB
testcase_20 AC 43 ms
6,160 KB
testcase_21 AC 7 ms
5,992 KB
testcase_22 AC 8 ms
6,048 KB
testcase_23 AC 8 ms
6,268 KB
testcase_24 AC 7 ms
5,956 KB
testcase_25 AC 7 ms
6,264 KB
権限があれば一括ダウンロードができます

ソースコード

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