結果

問題 No.1220 yukipoker
ユーザー milanis48663220milanis48663220
提出日時 2020-09-04 22:06:53
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 847 bytes
コンパイル時間 742 ms
コンパイル使用メモリ 92,396 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-04 22:23:55
合計ジャッジ時間 2,930 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,812 KB
testcase_01 AC 4 ms
6,940 KB
testcase_02 AC 5 ms
6,944 KB
testcase_03 AC 4 ms
6,940 KB
testcase_04 AC 4 ms
6,944 KB
testcase_05 AC 4 ms
6,940 KB
testcase_06 AC 4 ms
6,940 KB
testcase_07 AC 5 ms
6,940 KB
testcase_08 AC 4 ms
6,940 KB
testcase_09 AC 4 ms
6,940 KB
testcase_10 AC 4 ms
6,940 KB
testcase_11 AC 77 ms
6,940 KB
testcase_12 AC 82 ms
6,940 KB
testcase_13 AC 156 ms
6,940 KB
testcase_14 AC 157 ms
6,940 KB
testcase_15 AC 100 ms
6,944 KB
testcase_16 AC 101 ms
6,940 KB
testcase_17 AC 62 ms
6,940 KB
testcase_18 AC 91 ms
6,944 KB
testcase_19 AC 165 ms
6,940 KB
testcase_20 AC 150 ms
6,940 KB
testcase_21 AC 5 ms
6,940 KB
testcase_22 AC 5 ms
6,940 KB
testcase_23 AC 5 ms
6,940 KB
testcase_24 AC 4 ms
6,940 KB
testcase_25 AC 4 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>

using namespace std;
typedef long long ll;

double fac_log[200005];

double comb_log(int n, int m){
    return fac_log[n]-fac_log[n-m]-fac_log[m];
}

void init(){
    fac_log[0] = 0;
    fac_log[1] = 0;
    for(int i = 2; i <= 200000; i++){
        fac_log[i] = fac_log[i-1]+log((double)i);
    }
}

void solve(){
    int N, M, K; cin >> N >> M >> K;
    double f = log((double)M)+comb_log(N, K);
    double s = K*log((double)M)+log((double)(N-K+1));
    if(f < s) cout << "Flush" << endl;
    else cout << "Straight" << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    init();
    int Q; cin >> Q;
    for(int i = 0; i < Q; i++) solve();
}
0