結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-23 00:27:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 718 bytes |
| コンパイル時間 | 1,815 ms |
| コンパイル使用メモリ | 172,812 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-25 10:20:44 |
| 合計ジャッジ時間 | 2,566 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
map<int, int> mp;
for(int i = 0; i < 5; i++) {
int a;
cin >> a;
mp[a]++;
}
bool two1 = false, two2 = false, three = false;
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;
return 0;
}
if(three) {
cout << "THREE CARD" << endl;
return 0;
}
if(two1 && two2) {
cout << "TWO PAIR" << endl;
return 0;
}
if(two1) {
cout << "ONE PAIR" << endl;
return 0;
}
cout << "NO HAND" << endl;
return 0;
}