結果

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

テストケース

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

ソースコード

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];
  }
  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