結果

問題 No.1220 yukipoker
ユーザー MisterMister
提出日時 2020-09-04 23:05:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 698 bytes
コンパイル時間 802 ms
コンパイル使用メモリ 83,184 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2023-08-17 20:39:48
合計ジャッジ時間 2,722 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
6,160 KB
testcase_01 AC 7 ms
6,184 KB
testcase_02 AC 8 ms
6,080 KB
testcase_03 AC 7 ms
5,912 KB
testcase_04 AC 7 ms
5,980 KB
testcase_05 AC 8 ms
6,192 KB
testcase_06 AC 7 ms
6,024 KB
testcase_07 AC 7 ms
6,164 KB
testcase_08 AC 7 ms
6,116 KB
testcase_09 AC 7 ms
6,024 KB
testcase_10 AC 7 ms
5,920 KB
testcase_11 AC 25 ms
6,024 KB
testcase_12 AC 26 ms
6,156 KB
testcase_13 AC 44 ms
6,084 KB
testcase_14 AC 44 ms
6,076 KB
testcase_15 AC 31 ms
6,092 KB
testcase_16 AC 36 ms
6,036 KB
testcase_17 AC 24 ms
5,920 KB
testcase_18 AC 30 ms
6,184 KB
testcase_19 AC 45 ms
6,084 KB
testcase_20 AC 47 ms
6,228 KB
testcase_21 AC 7 ms
6,152 KB
testcase_22 AC 7 ms
6,120 KB
testcase_23 AC 8 ms
5,992 KB
testcase_24 AC 8 ms
6,052 KB
testcase_25 AC 9 ms
6,272 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::log1p(n - k) + 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