結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー saytakaPC
提出日時 2015-10-21 17:10:01
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 862 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,210 ms
コンパイル使用メモリ 176,400 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-04-03 08:47:32
合計ジャッジ時間 1,531 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const int INF=1e9;
const int MOD=100000;
int B=1000000;
string yaku[6]={"NO HAND","ONE PAIR","TWO PAIR","THREE CARD","FULL HOUSE"};
int main(){
      int a,cnt[13];
      memset(cnt,0,sizeof(cnt));
      REP(i,5){
            cin>>a;a--;
            cnt[a]++;
      }
      int pair=0,ans=0;
      REP(i,13){
            if(cnt[i]==3){
                  if(ans==2)ans=4;
                  else ans=3;
            }else if(cnt[i]==2){
                  if(ans==3)ans=4;
                  pair++;
            }
      }
      if(ans==0)ans=pair;
      cout<<yaku[ans]<<endl;
}
0