結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2015-12-04 01:29:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 1,310 ms |
コンパイル使用メモリ | 58,968 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 12:18:23 |
合計ジャッジ時間 | 1,588 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <iostream> #include <algorithm> #include <numeric> #include <sstream> #include <cstdio> using namespace std; int main(int argc, char *argv[]) { int cnt[14] = {}; for (int i = 0; i < 5; ++i) { int a; cin >> a; cnt[a] += 1; } int pairs = 0, three = 0; for (int i = 1; i <= 13; ++i) { pairs += cnt[i] == 2; three += cnt[i] == 3; } string ans = "NO HAND"; if (three) { ans = pairs ? "FULL HOUSE" : "THREE CARD"; } else if (pairs) { ans = pairs >= 2 ? "TWO PAIR" : "ONE PAIR"; } cout << ans << endl; return 0; }