結果

問題 No.1220 yukipoker
ユーザー kappybar
提出日時 2020-09-04 22:51:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,207 ms / 2,000 ms
コード長 1,251 bytes
コンパイル時間 6,588 ms
コンパイル使用メモリ 392,760 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-11-26 20:47:23
合計ジャッジ時間 17,321 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
//
using Bint = mp::cpp_int;
// 1024(TLE)
using Real = mp::number<mp::cpp_dec_float<100>>;
Real fact[100001];
Real mypow(Real x, long long n) {
Real ret = 1;
while (n > 0) {
if (n & 1) ret = (ret * x) ;
x = (x * x) ;
n >>= 1;
}
return ret;
}
int main(){
fact[0] = 1;
for(int i=1;i<100001;i++) fact[i] = fact[i-1] * (Real)i;
//cout << fact[100000] << endl;
int q;
cin >> q;
while(q--){
int n,m,k;
cin >> n >> m >> k;
Real com = (fact[n] / fact[k]) / fact[n-k];
Real p = (Real)(n-k+1) * mypow(m,k-1);
if(com < p) cout << "Flush" << endl;
else cout << "Straight" << endl;
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0