結果
| 問題 | No.227 簡単ポーカー | 
| コンテスト | |
| ユーザー |  ei1333333 | 
| 提出日時 | 2016-09-08 02:53:06 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 889 bytes | 
| コンパイル時間 | 1,309 ms | 
| コンパイル使用メモリ | 160,932 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-15 22:15:27 | 
| 合計ジャッジ時間 | 1,821 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int A[5];
  for(int i = 0; i < 5; i++) {
    cin >> A[i];
  }
  sort(A, A + 5);
  do {
    if(A[0] == A[1] && A[1] == A[2] && A[2] != A[3] && A[3] == A[4]) {
      cout << "FULL HOUSE" << endl;
      return(0);
    }
  } while(next_permutation(A, A + 5));
  do {
    if(A[0] == A[1] && A[1] == A[2] && A[2] != A[3] && A[2] != A[4]) {
      cout << "THREE CARD" << endl;
      return(0);
    }
  } while(next_permutation(A, A + 5));
  do {
    if(A[0] == A[1] && A[1] != A[2] && A[2] == A[3] && A[0] != A[4] && A[2] != A[4]) {
      cout << "TWO PAIR" << endl;
      return(0);
    }
  } while(next_permutation(A, A + 5));
  do {
    if(A[0] == A[1] && A[0] != A[2] && A[0] != A[3] && A[0] != A[4]) {
      cout << "ONE PAIR" << endl;
      return(0);
    }
  } while(next_permutation(A, A + 5));
  cout << "NO HAND" << endl;
}
            
            
            
        