結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2016-03-28 18:13:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,116 bytes |
| コンパイル時間 | 799 ms |
| コンパイル使用メモリ | 85,772 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-02 06:39:26 |
| 合計ジャッジ時間 | 1,191 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 227.cc: No.227 簡単ポーカー - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
const int N = 5;
const int C = 13;
/* typedef */
/* global variables */
int cs[C];
/* subroutines */
/* main */
int main() {
int maxc0 = 0, maxc1 = 0;
for (int i = 0; i < N; i++) {
int ai;
cin >> ai;
cs[--ai]++;
}
for (int i = 0; i < C; i++) {
if (maxc0 <= cs[i]) maxc1 = maxc0, maxc0 = cs[i];
else if (maxc1 < cs[i]) maxc1 = cs[i];
}
//printf("maxc0=%d, maxc1=%d\n", maxc0, maxc1);
string ans;
if (maxc0 == 3) {
if (maxc1 == 2) ans = "FULL HOUSE";
else ans = "THREE CARD";
}
else if (maxc0 == 2) {
if (maxc1 == 2) ans = "TWO PAIR";
else ans = "ONE PAIR";
}
else ans = "NO HAND";
cout << ans << endl;
return 0;
}
tnakao0123