結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2020-12-05 17:32:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 780 bytes |
コンパイル時間 | 1,660 ms |
コンパイル使用メモリ | 166,508 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 18:05:48 |
合計ジャッジ時間 | 2,255 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> #include <string> using namespace std; int main() { int a[14]={0},b; int n = 0,n2 = 0; string hand; for(int i=0; i<5; i++){ cin >> b; a[b]++; } for(int i=1; i<14; i++){ if(a[i] == 2) n++; if(a[i] == 3) n2++; } switch(n){ case 0: if(n2==1){ hand = "THREE CARD"; }else{ hand = "NO HAND"; } break; case 1: if(n2==1){ hand = "FULL HOUSE"; }else{ hand = "ONE PAIR"; } break; case 2: hand = "TWO PAIR"; break; default: break; } cout << hand << endl; return 0; }