結果
問題 |
No.227 簡単ポーカー
|
ユーザー |
|
提出日時 | 2021-08-26 22:26:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 514 bytes |
コンパイル時間 | 1,422 ms |
コンパイル使用メモリ | 160,560 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 20:45:36 |
合計ジャッジ時間 | 2,099 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int ch[14]={},a[5],ans=0; for(int i=0; i<5; i++) cin >> a[i]; for(int i=0; i<5; i++) ch[a[i]]++; sort(ch,ch+14); reverse(ch,ch+14); //for(int i=0; i<14; i++) cout << ch[i] << endl; if(ch[0]==3){ if(ch[1]==2) cout << "FULL HOUSE"; else cout << "THREE CARD"; } else if(ch[0]==2){ if(ch[1]==2) cout << "TWO PAIR"; else cout << "ONE PAIR"; } else cout << "NO HAND"; cout << endl; }