結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2021-11-16 20:03:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 692 bytes |
コンパイル時間 | 4,476 ms |
コンパイル使用メモリ | 257,836 KB |
最終ジャッジ日時 | 2025-01-25 18:48:13 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#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; }