結果

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

ソースコード

diff #

#include <bits/stdc++.h>

int main() {
  
  int a[8];
  int num[16] = {};
  int pair[8] = {};

  for(int i = 0; i < 5; ++i) {
    std::cin >> a[i];
  }

  for(int i = 0; i < 5; ++i) {
    num[a[i]] += 1;
  }

  for(int i = 1; i <= 13; ++i) {
    pair[num[i]] += 1;
  }

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