結果
問題 |
No.227 簡単ポーカー
|
ユーザー |
![]() |
提出日時 | 2019-03-25 21:00:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 767 bytes |
コンパイル時間 | 1,701 ms |
コンパイル使用メモリ | 172,892 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 10:08:42 |
合計ジャッジ時間 | 2,637 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int a; map<int, int> mp; bool two1 = false, two2 = false, three = false; int main() { for (int i = 0; i < 5; i++) { cin >> a; mp[a]++; } for (auto i : mp) { if (i.second == 3) three = true; if (i.second == 2 && !two1) { two1 = true; continue; } if (i.second == 2 && two1) two2 = true; } if (three && two1) cout << "FULL HOUSE" << endl; else if (three) cout << "THREE CARD" << endl; else if (two1 && two2) cout << "TWO PAIR" << endl; else if (two1) cout << "ONE PAIR" << endl; else cout << "NO HAND" << endl; }