結果
問題 |
No.227 簡単ポーカー
|
ユーザー |
![]() |
提出日時 | 2016-09-24 20:46:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 873 bytes |
コンパイル時間 | 685 ms |
コンパイル使用メモリ | 76,252 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 10:51:31 |
合計ジャッジ時間 | 1,083 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#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 PAIR" << endl; } else if (sta[1] == 1) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }