結果

問題 No.1220 yukipoker
ユーザー DriceDrice
提出日時 2020-09-04 22:19:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 38,784 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 23:24:56
合計ジャッジ時間 1,771 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 16 ms
5,376 KB
testcase_12 AC 17 ms
5,376 KB
testcase_13 AC 31 ms
5,376 KB
testcase_14 AC 33 ms
5,376 KB
testcase_15 AC 21 ms
5,376 KB
testcase_16 AC 23 ms
5,376 KB
testcase_17 AC 14 ms
5,376 KB
testcase_18 AC 18 ms
5,376 KB
testcase_19 AC 32 ms
5,376 KB
testcase_20 AC 32 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 3 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 3 ms
5,376 KB
testcase_25 AC 3 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<cmath>
double f[100005];

void preWork(int n){
    f[0] = 0.0;
    for(int i = 1; i <= n; i++){
        f[i] = f[i-1]+log(i);
    }
}

int main(){
    preWork(100000);
    int T;
    scanf("%d",&T);
    while(T--){
    int n,m,k;
    scanf("%d%d%d",&n,&m,&k);
    double res0 = (double)k*log(m)+f[k]+log(n-k+1);
    double res1 = f[n]-f[n-k]+log(m);
    if(res0<res1) printf("Straight\n");
    else printf("Flush\n");
}
    return 0;
}
0