結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2018-10-25 01:59:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 709 bytes |
コンパイル時間 | 1,968 ms |
コンパイル使用メモリ | 178,508 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-19 05:38:50 |
合計ジャッジ時間 | 2,355 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include "bits/stdc++.h" using namespace std; int main() { vector<int> A(5); set<int> m; for (int i = 0; i < 5; i++) { cin >> A[i]; m.insert(A[i]); } map<char, int> mapp; for (int i = 0; i < 5; i++) { mapp[A[i]]++; } int cnt=0; int n=m.size(); if (n == 2) { bool f = false; for (auto itr = mapp.begin(); itr != mapp.end(); itr++) { if (itr->second == 4) f = true; } cout << (f ? "NO HAND" : "FULL HOUSE") << endl; } else if (n == 3) { bool f=false; for (auto itr = mapp.begin(); itr != mapp.end(); itr++) { if(itr->second==3) f=true; } cout << (f?"THREE CARD":"TWO PAIR") << endl; } else if(n==4) cout <<"ONE PAIR" << endl; else { cout << "NO HAND" << endl; } }