結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-19 22:28:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 669 bytes |
| コンパイル時間 | 473 ms |
| コンパイル使用メモリ | 62,300 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-07 04:05:01 |
| 合計ジャッジ時間 | 931 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
using namespace std;
int main() {
vector<int> card(14, 0);
int a;
for (int i = 0; i < 5; i++) {
cin >> a;
card[a]++;
}
int p2 = 0;
int p3 = 0;
for (int i = 1; i <= 13; i++) {
switch (card[i]) {
case 2: p2++; break;
case 3: p3++; break;
default: break;
}
}
string hand;
if (p3 == 1 && p2 == 1) {
hand = "FULL HOUSE";
} else if (p3 == 1) {
hand = "THREE CARD";
} else if (p2 == 2) {
hand = "TWO PAIR";
} else if (p2 == 1) {
hand = "ONE PAIR";
} else {
hand = "NO HAND";
}
cout << hand << endl;
return 0;
}