結果
| 問題 | No.227 簡単ポーカー | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-10-24 23:21:37 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 1,512 bytes | 
| コンパイル時間 | 1,536 ms | 
| コンパイル使用メモリ | 172,752 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-21 17:53:22 | 
| 合計ジャッジ時間 | 2,124 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 | 
ソースコード
#include <bits/stdc++.h>
#define show(x) cerr << #x << " = " << x << endl
using namespace std;
using ll = long long;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}
template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}
constexpr ll MOD = (ll)1e9 + 7LL;
template <typename T>
constexpr T INF = numeric_limits<T>::max() / 64;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> c(5);
    for (int i = 0; i < 5; i++) {
        cin >> c[i];
    }
    sort(c.begin(), c.end());
    auto zip = c;
    zip.erase(unique(zip.begin(), zip.end()), zip.end());
    if (zip.size() == 1) {
        cout << "NO HAND" << endl;
    } else if (zip.size() == 2) {
        if (c[1] == c[2] and c[2] == c[3]) {
            cout << "NO HAND" << endl;
        } else {
            cout << "FULL HOUSE" << endl;
        }
    } else if (zip.size() == 3) {
        for (int i = 0; i < 3; i++) {
            if (c[i] == c[i + 1] and c[i + 1] == c[i + 2]) {
                cout << "THREE CARD" << endl;
                return 0;
            }
        }
        cout << "TWO PAIR" << endl;
    } else if (zip.size() == 4) {
        cout << "ONE PAIR" << endl;
    } else {
        cout << "NO HAND" << endl;
    }
    return 0;
}
            
            
            
        