結果
問題 |
No.227 簡単ポーカー
|
ユーザー |
|
提出日時 | 2020-09-07 21:41:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 662 bytes |
コンパイル時間 | 2,176 ms |
コンパイル使用メモリ | 194,088 KB |
最終ジャッジ日時 | 2025-01-14 08:16:06 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; string solve() { int x; vector<int> v(14); rep(i, 0, 5) { cin >> x; v[x]++; } int c3 = 0, c2 = 0; rep(i, 1, 14) { if (v[i] == 3) c3++; if (v[i] == 2) c2++; } string ans = "NO HAND"; if (c3 == 1 && c2 == 1) { ans = "FULL HOUSE"; } else if (c3 == 1 && c2 == 0) { ans = "THREE CARD"; } else if (c3 == 0 && c2 == 2) { ans = "TWO PAIR"; } else if (c3 == 0 && c2 == 1) { ans = "ONE PAIR"; } return ans; } int main() { cin.tie(0); ios::sync_with_stdio(false); cout << solve() << endl; getchar(); }