結果
| 問題 | No.227 簡単ポーカー | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-05-12 21:26:50 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 571 bytes | 
| コンパイル時間 | 2,360 ms | 
| コンパイル使用メモリ | 200,876 KB | 
| 実行使用メモリ | 7,844 KB | 
| 最終ジャッジ日時 | 2025-05-12 21:26:54 | 
| 合計ジャッジ時間 | 3,219 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 | 
ソースコード
#include <bits/stdc++.h>
int main() {
  std::map <int, int> cnt_of_number, cnt_of_cnt;
  for(int i = 0; i < 5; i ++) {
    int x; std::cin >> x;
    cnt_of_number[x] ++;
  }
  for(auto [x, c] : cnt_of_number) {
    cnt_of_cnt[c] ++;
  }
  std::string ans = "";
  if(cnt_of_cnt[3] >= 1 && cnt_of_cnt[2] >= 1) {
    ans = "FULL HOUSE";
  } else if(cnt_of_cnt[3] >= 1) {
    ans = "THREE CARD";
  } else if(cnt_of_cnt[2] >= 2) {
    ans = "TWO PAIR";
  } else if(cnt_of_cnt[2] >= 1) {
    ans = "ONE PAIR";
  } else {
    ans = "NO HAND";
  }
  std::cout << ans << '\n';
}
            
            
            
        