結果

問題 No.227 簡単ポーカー
ユーザー maine_honzukimaine_honzuki
提出日時 2020-12-25 18:11:01
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 618 bytes
コンパイル時間 3,220 ms
コンパイル使用メモリ 214,316 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-23 17:45:48
合計ジャッジ時間 3,625 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    map<int, int> mp;
    for (int i = 0; i < 5; i++) {
        int a;
        cin >> a;
        mp[a] += 1;
    }
    vector<int> cnt;
    for (auto& p : mp)
        cnt.emplace_back(p.second);
    sort(cnt.begin(), cnt.end());

    string ans;
    if (cnt == vector{2, 3})
        ans = "FULL HOUSE";
    else if (cnt == vector{1, 1, 3})
        ans = "THREE CARD";
    else if (cnt == vector{1, 2, 2})
        ans = "TWO PAIR";
    else if (cnt == vector{1, 1, 1, 2})
        ans = "ONE PAIR";
    else
        ans = "NO HAND";

    cout << ans << endl;
}
0