結果

問題 No.227 簡単ポーカー
ユーザー michonz4
提出日時 2019-06-04 11:23:07
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 534 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 65,812 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-17 20:45:03
合計ジャッジ時間 1,100 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
  vector<int> v(14);

  for (int i=0; i<5; i++) {
    int t;
    cin >> t;
    v[t]++;
  }

  sort(v.begin(), v.end(), greater<int>());

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