結果

問題 No.227 簡単ポーカー
ユーザー ut0sut0s
提出日時 2019-09-03 23:31:40
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 908 bytes
コンパイル時間 1,751 ms
コンパイル使用メモリ 177,084 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 09:28:33
合計ジャッジ時間 2,647 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

/**
  @file 227.cpp
  @title  No.227 簡単ポーカー - yukicoder
  @url https://yukicoder.me/problems/no/227
**/

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

typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)

int main() {
  vector<int> A(5, 0);
  map<int, int> m;
  REP(i, 5) {
    cin >> A[i];
    m[A[i]]++;
  }

  vector<int> deck;
  for (auto e : m) {
    // cout << e.second << endl;
    deck.push_back(e.second);
  }
  sort(ALL(deck));

  if (deck.size() == 2 && deck[0] == 2 && deck[1] == 3) {
    cout << "FULL HOUSE" << endl;
  } else if (deck.size() == 3 && deck[2] == 3) {
    cout << "THREE CARD" << endl;
  } else if (deck.size() == 3 && deck[1] == 2 && deck[2] == 2) {
    cout << "TWO PAIR" << endl;
  } else if (m.size() == 4) {
    cout << "ONE PAIR" << endl;
  } else {
    cout << "NO HAND" << endl;
  }

  return 0;
}
0