結果

問題 No.227 簡単ポーカー
ユーザー focusfocus
提出日時 2018-01-22 12:48:43
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 695 bytes
コンパイル時間 757 ms
コンパイル使用メモリ 64,368 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 20:22:16
合計ジャッジ時間 1,530 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int main(){
    vector<int> A;
    int x,count=0;
    bool flag1,flag2;
    for(int i=0;i<5;i++){
        cin >> x;
        A.push_back(x);
    }
    A.push_back(0);
    for(int i=0;i<5;i++){
        if(A[i]==A[i+1]){
            count++;
        }
        if(A[i]!=A[i+1]){
            if(count==2)    flag1 = 1;
            else if(count==3)   flag2 = 1;
            count = 0;
        }
    }
    if(flag1==1&&flag2==1)  cout << "FULL HOUSE";
    else if(flag1==1)   cout << "TWO PAIR";
    else if(flag2==1)   cout << "THREE CARD";
    else    cout << "NO HAND";
    return 0;
}

0