結果

問題 No.227 簡単ポーカー
ユーザー SSRS
提出日時 2020-07-18 21:17:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 556 bytes
コンパイル時間 1,816 ms
コンパイル使用メモリ 173,476 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 07:46:07
合計ジャッジ時間 2,434 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<int> A(5);
  for (int i = 0; i < 5; i++){
    cin >> A[i];
  }
  vector<int> cnt(13, 0);
  for (int i = 0; i < 5; i++){
    cnt[A[i] - 1]++;
  }
  sort(cnt.rbegin(), cnt.rend());
  if (cnt[0] == 3 && cnt[1] == 2){
    cout << "FULL HOUSE" << endl;
  } else if (cnt[0] == 3){
    cout << "THREE CARD" << endl;
  } else if (cnt[0] == 2 && cnt[1] == 2){
    cout << "TWO PAIR" << endl;
  } else if (cnt[0] == 2){
    cout << "ONE PAIR" << endl;
  } else {
    cout << "NO HAND" << endl;
  }
}
0