結果
| 問題 |
No.1220 yukipoker
|
| コンテスト | |
| ユーザー |
milanis48663220
|
| 提出日時 | 2020-09-04 22:06:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 161 ms / 2,000 ms |
| コード長 | 847 bytes |
| コンパイル時間 | 940 ms |
| コンパイル使用メモリ | 92,052 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-26 12:56:05 |
| 合計ジャッジ時間 | 3,122 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
#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();
}
milanis48663220