結果
問題 | No.1220 yukipoker |
ユーザー |
![]() |
提出日時 | 2020-09-04 21:39:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 47 ms / 2,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 1,833 ms |
コンパイル使用メモリ | 192,460 KB |
最終ジャッジ日時 | 2025-01-14 05:19:25 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:12:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d", &test); | ~~~~~^~~~~~~~~~~~~ main.cpp:15:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d%d%d", &n, &m, &k); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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;}