結果

問題 No.227 簡単ポーカー
ユーザー yoshi_kyoshi_k
提出日時 2017-09-23 00:54:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,254 bytes
コンパイル時間 914 ms
コンパイル使用メモリ 101,108 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 02:21:41
合計ジャッジ時間 1,603 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <functional>
#include <utility>
#include <iterator>

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define INF 2000000000
//#define int long long int

#ifdef LOCAL
  #define eprintf(...) fprintf(stdout, __VA_ARGS__)
#else
  #define eprintf(...) 0
#endif

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;

int main() {
  map<int, int> mp;
  //vector<int> v(5);
  int t;
  REP(i, 5) {
    cin >> t;
    mp[t]++;
  }

  int c2 = 0;
  int c3 = 0;
  for(auto m : mp) {
    if(m.second == 2) {
      c2++;
    }
    else if(m.second == 3) {
      c3++;
    }
  }
  if(c2 >= 1 && c3 >= 1) {
    cout << "FULL HOUSE" << endl;
  }
  else if(c3 >= 1) {
    cout << "THREE CARD" << endl;
  }
  else if(c2 >= 2) {
    cout << "TWO PAIR" << endl;
  }
  else if(c2 >= 1) {
    cout << "ONE PAIR" << endl;
  }
  else {
    cout << "NO HAND" << endl;
  }

  return 0;
}
0