結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
prog470
|
| 提出日時 | 2016-09-24 20:45:28 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 874 bytes |
| コンパイル時間 | 641 ms |
| コンパイル使用メモリ | 76,372 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-18 10:51:03 |
| 合計ジャッジ時間 | 1,266 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 2 |
ソースコード
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
map<int, int> m;
for (int i = 0; i < 5; i++) {
int t;
cin >> t;
m[t]++;
}
int sta[3] = {};
map<int, int>::iterator it = m.begin();
while (it != m.end()) {
if ((*it).second == 3) {
sta[0] = 1;
}
if ((*it).second == 2) {
if(sta[1] == 0) sta[1] = 1;
else sta[2] = 1;
}
it++;
}
if (sta[0] == 1 && sta[1] == 1) {
cout << "FULL HOUSE" << endl;
}
else if (sta[0] == 1) {
cout << "THREE CARD" << endl;
}
else if (sta[1] == 1 && sta[2] == 1) {
cout << "TWO PAIRE" << endl;
}
else if (sta[1] == 1) {
cout << "ONE PAIR" << endl;
}
else {
cout << "NO HAND" << endl;
}
return 0;
}
prog470