結果

問題 No.227 簡単ポーカー
ユーザー satanicsatanic
提出日時 2015-12-06 19:05:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 630 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 58,692 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-12 17:29:08
合計ジャッジ時間 1,180 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

#define SAY(s) {cout << s << "\n"; return 0;}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int input;
  vector<int> card(13, 0);
  int two_cnt=0, three_cnt=0;

  for(int i=0; i<5; ++i){
    cin >> input;
    ++card[input-1];
  }
  for(int i=0; i<13; ++i){
    if(card[i]==2)      ++two_cnt;
    else if(card[i]==3) ++three_cnt;
  }
  if(three_cnt==1 && two_cnt==1) SAY("FULL HOUSE");
  if(three_cnt==1 && two_cnt==0) SAY("THREE CARD");
  if(three_cnt==0 && two_cnt==2) SAY("TWO PAIR");
  if(three_cnt==0 && two_cnt==1) SAY("ONE PAIR");
  SAY("NO HAND");
}
0