結果

問題 No.1220 yukipoker
ユーザー 钟梓皓钟梓皓
提出日時 2020-09-04 21:39:24
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 1,841 ms
コンパイル使用メモリ 196,732 KB
実行使用メモリ 4,576 KB
最終ジャッジ日時 2023-08-17 15:12:24
合計ジャッジ時間 3,548 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
4,376 KB
testcase_01 AC 4 ms
4,392 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 4 ms
4,380 KB
testcase_04 AC 3 ms
4,576 KB
testcase_05 AC 4 ms
4,384 KB
testcase_06 AC 4 ms
4,376 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 4 ms
4,376 KB
testcase_09 AC 4 ms
4,380 KB
testcase_10 AC 4 ms
4,380 KB
testcase_11 AC 20 ms
4,376 KB
testcase_12 AC 22 ms
4,376 KB
testcase_13 AC 39 ms
4,376 KB
testcase_14 AC 37 ms
4,440 KB
testcase_15 AC 25 ms
4,376 KB
testcase_16 AC 28 ms
4,380 KB
testcase_17 AC 18 ms
4,396 KB
testcase_18 AC 23 ms
4,380 KB
testcase_19 AC 38 ms
4,400 KB
testcase_20 AC 41 ms
4,384 KB
testcase_21 AC 4 ms
4,376 KB
testcase_22 AC 4 ms
4,380 KB
testcase_23 AC 4 ms
4,380 KB
testcase_24 AC 4 ms
4,380 KB
testcase_25 AC 4 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

const int N = 100010;

double fac[N];

int main(){
    for (int i = 1; i < N; ++ i){
        fac[i] = fac[i - 1] + std::log(i);
    }
    int test;
    scanf("%d", &test);
    while (test --){
        int n, m, k;
        scanf("%d%d%d", &n, &m, &k);
        double prob1 = fac[n] - fac[k] - fac[n - k] + std::log(m);
        double prob2 = std::log(n - k + 1) + k * std::log(m);
        puts(prob1 < prob2 ? "Flush" : "Straight");
    }
    return 0;
}
0