結果

問題 No.227 簡単ポーカー
ユーザー 沙耶花沙耶花
提出日時 2021-11-16 20:03:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 692 bytes
コンパイル時間 8,517 ms
コンパイル使用メモリ 267,448 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-22 20:31:05
合計ジャッジ時間 7,073 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001


int main(){
	
	map<int,int> mp;
	rep(i,5){
		int a;
		cin>>a;
		mp[a]++;
	}
	
	vector<int> t;
	for(auto a:mp)t.push_back(a.second);
	sort(t.begin(),t.end());
	string ans = "";
	if(t.size()==2 && t[0]==2&&t[1]==3)ans = "FULL HOUSE";
	else if(binary_search(t.begin(),t.end(),3))ans = "THREE CARD";
	else if(t.size()==3 && t[1]==2&&t[2]==2)ans = "TWO PAIR";
	else if(binary_search(t.begin(),t.end(),2))ans = "ONE PAIR";
	else ans = "NO HAND";
	
	cout<<ans<<endl;
	
	
	return 0;
}
0