結果
問題 | No.227 簡単ポーカー |
ユーザー |
|
提出日時 | 2017-07-16 20:07:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 650 bytes |
コンパイル時間 | 480 ms |
コンパイル使用メモリ | 56,660 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-08 04:26:32 |
合計ジャッジ時間 | 1,001 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int a; int c[13] = {}; for(int i=0; i<5; i++){ cin >> a; c[a-1]++; } int pair=0, three=0; for(int i=0; i<13; i++){ switch (c[i]) { case 2 : pair++; break; case 3 : three++; break; default : continue; } } if(pair and three) cout << "FULL HOUSE" << endl; else if(three) cout << "THREE CARD" << endl; else if(pair == 2) cout << "TWO PAIR" << endl; else if(pair) cout << "ONE PAIR" << endl; else cout << "NO HAND" << endl; return 0; }