結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
focus
|
| 提出日時 | 2018-01-22 12:51:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 716 bytes |
| コンパイル時間 | 696 ms |
| コンパイル使用メモリ | 65,048 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-25 22:20:35 |
| 合計ジャッジ時間 | 1,395 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 4 |
ソースコード
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int main(){
vector<int> A;
int x,count=0;
bool flag1=0,flag2=0;
for(int i=0;i<5;i++){
cin >> x;
A.push_back(x);
}
sort(A.begin(),A.end());
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==1) flag1 = 1;
else if(count==2) flag2 = 1;
count = 0;
}
}
if(flag1&&flag2) cout << "FULL HOUSE";
else if(flag1) cout << "TWO PAIR";
else if(flag2) cout << "THREE CARD";
else cout << "NO HAND";
return 0;
}
focus