結果
問題 |
No.227 簡単ポーカー
|
ユーザー |
|
提出日時 | 2019-07-22 20:40:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 596 bytes |
コンパイル時間 | 1,574 ms |
コンパイル使用メモリ | 167,496 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 18:39:43 |
合計ジャッジ時間 | 2,239 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; int a[13]; bool one, two, three; int main() { int t; for (int i = 0; i < 5; i++) { cin >> t; a[t - 1]++; } for (int i = 0; i < 13; i++) { if (a[i] == 3) three = true; else if (a[i] == 2 && one) two = true; else if (a[i] == 2 && !one) one = true; } if (three && one) cout << "FULL HOUSE" << endl; else if (three) cout << "THREE CARD" << endl; else if (two) cout << "TWO PAIR" << endl; else if (one) cout << "ONE PAIR" << endl; else cout << "NO HAND" << endl; return 0; }