結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2015-06-19 23:02:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,960 bytes |
コンパイル時間 | 769 ms |
コンパイル使用メモリ | 85,604 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-07-07 04:12:40 |
合計ジャッジ時間 | 1,432 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 1 |
ソースコード
#include<cstdio>#include<cstdlib>#include<cstring>#include<cmath>//#include<cctype>#include<climits>#include<iostream>#include<string>#include<vector>#include<map>//#include<list>#include<queue>#include<deque>#include<algorithm>//#include<numeric>#include<utility>#include<complex>//#include<memory>#include<functional>#include<cassert>#include<set>const int dx[] = {1, 0, -1, 0};const int dy[] = {0, 1, 0, -1};using namespace std;typedef long long ll;typedef vector<int> vi;typedef vector<ll> vll;typedef pair<int, int> pii;typedef complex<double> C;int a[5];void solve() {if (a[0] == a[1] && a[1] == a[2] && a[3] == a[4] && a[0] != a[4]) {cout << "FULL HOUSE" << endl;return;}if (a[0] == a[1] && a[2] == a[3] && a[3] == a[4] && a[0] != a[4]) {cout << "FULL HOUSE" << endl;return;}if (a[0] == a[1] && a[1] == a[2] && a[2] != a[3]) {cout << "THREE CARD" << endl;return;}if (a[2] == a[1] && a[3] == a[2] && a[3] != a[4]) {cout << "THREE CARD" << endl;return;}if (a[4] == a[3] && a[3] == a[2] && a[1] != a[2]) {cout << "THREE CARD" << endl;return;}if (a[0] == a[1] && a[2] == a[3] && a[1] != a[2]) {cout << "TWO PAIR" << endl;return;}if (a[1] == a[2] && a[4] == a[3] && a[0] != a[1]) {cout << "TWO PAIR" << endl;return;}for (int i = 0; i < 4; i++) {if (a[i] == a[i+1]) {bool ng = false;if (i > 0) if (a[i] == a[i-1]) ng = true;if (i < 3) if (a[i+1] == a[i+2]) ng = true;if (!ng) {cout << "ONE PAIR" << endl;return;}}}cout << "NO HAND" << endl;}int main() {cin.tie(0);ios::sync_with_stdio(false);for (int i = 0; i < 5; i++) cin >> a[i];sort(a, a+5);solve();return 0;}