結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2015-09-03 18:46:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 419 bytes |
コンパイル時間 | 1,165 ms |
コンパイル使用メモリ | 161,972 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 21:53:56 |
合計ジャッジ時間 | 1,798 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d", &a); | ~~~~~^~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; int cnt[13]; string s[] = {"NO HAND", "FULL HOUSE", "THREE CARD", "TWO PAIR", "ONE PAIR"}; int main() { for (int i = 0; i < 5; i++){ int a; scanf("%d", &a); cnt[--a]++; } sort(cnt, cnt + 13, greater<int>()); int r = 0; if (cnt[0] == 3){ r++; if (cnt[1] != 2) r++; } else if (cnt[0] == 2){ r += 3; if (cnt[1] != 2) r++; } cout << s[r] << endl; }