結果
問題 | No.227 簡単ポーカー |
ユーザー | newlife171128 |
提出日時 | 2018-02-14 22:50:39 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,832 bytes |
コンパイル時間 | 1,342 ms |
コンパイル使用メモリ | 163,376 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-02 11:46:02 |
合計ジャッジ時間 | 1,933 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> #include "bits/stdc++.h" #include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <string> #include <sstream> #include <cmath> #include <stack> #include <queue> #include <cctype> #include <stdio.h> #include <map> #include <unordered_map> #include <string.h> #include <utility> typedef long long ll; const int INF = 1e8; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) using namespace std; typedef pair<int, int> P; vector<int> cards; int main() { for(int i=0; i<5; i ++){ int tmp; cin>>tmp; cards.push_back(tmp); } sort(cards.begin(),cards.end()); if(cards[0] == cards[1] && cards[1] == cards[2] && cards[2] == cards[3] && cards[3] == cards[4]){ cout<<"NO HAND"<<endl; return 0; } if((cards[0] == cards[1] && cards[1] == cards[2] && cards[3] == cards[4]) || (cards[2] == cards[3] && cards[3] == cards[4] && cards[0] == cards[1])){ cout<<"FULL HOUSE"<<endl; return 0; }else if(cards[0] == cards[1] && cards[1] == cards[2] && cards[2] != cards[3]|| cards[1] == cards[2] && cards[2] == cards[3] && cards[0] != cards[1]&& cards[3] != cards[4]|| cards[2] == cards[3] && cards[3] == cards[4] && cards[1] != cards[2]){ cout<<"THREE CARD"<<endl; return 0; }else if (cards[0] == cards[1] && cards[2] == cards[3] && cards[1] != cards[2] ||cards[0] == cards[1] && cards[3] == cards[4] && cards[1] != cards[3] || cards[1] == cards[2] && cards[3] == cards[4]&& cards[2] != cards[3]){ cout<<"TWO PAIR"<<endl; return 0; }else if (cards[0] == cards[1] && cards[1] != cards[2]|| cards[1] == cards[2] && cards[2] != cards[3] && cards[0] != cards[1]|| cards[2] == cards[3] && cards[1] != cards[2] && cards[3] != cards[4]|| cards[3] == cards[4]&& cards[2] != cards[3]) { cout<<"ONE PAIR"<<endl; return 0; }else { cout<<"NO HAND"<<endl; } return 0; }