結果

問題 No.227 簡単ポーカー
ユーザー cowgirlcowgirl
提出日時 2018-09-29 19:57:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 1,592 ms
コンパイル使用メモリ 163,952 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 13:01:54
合計ジャッジ時間 2,208 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    std::vector<int> a(5); cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4];
    int rel=0;
    for(int i=0; i<5; i++){
        int counter = 0;
        for(int j=i+1; j<5; j++){
            if(a[i] == a[j]) counter++;
        }
        if(counter >= 1){
            if(counter == 1){
                rel++;                    
            }
            else{
                rel += 3;
            }
        }
    }
    string s;
    if(rel == 1) s = "ONE PAIR";
    else if(rel == 2) s = "TWO PAIR";
    else if(rel == 4) s = "THREE CARD";
    else if(rel == 5) s = "FULL HOUSE";
    else s = "NO HANDS";
    cout << s << endl;
}
0