結果
問題 | No.227 簡単ポーカー |
ユーザー | Mayimg |
提出日時 | 2018-12-23 00:27:11 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 718 bytes |
コンパイル時間 | 3,092 ms |
コンパイル使用メモリ | 173,492 KB |
実行使用メモリ | 4,348 KB |
最終ジャッジ日時 | 2023-10-26 02:16:50 |
合計ジャッジ時間 | 3,762 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,348 KB |
testcase_01 | AC | 2 ms
4,348 KB |
testcase_02 | AC | 3 ms
4,348 KB |
testcase_03 | AC | 2 ms
4,348 KB |
testcase_04 | AC | 2 ms
4,348 KB |
testcase_05 | AC | 2 ms
4,348 KB |
testcase_06 | AC | 2 ms
4,348 KB |
testcase_07 | AC | 2 ms
4,348 KB |
testcase_08 | AC | 2 ms
4,348 KB |
testcase_09 | AC | 2 ms
4,348 KB |
testcase_10 | AC | 2 ms
4,348 KB |
testcase_11 | AC | 2 ms
4,348 KB |
testcase_12 | AC | 2 ms
4,348 KB |
testcase_13 | AC | 2 ms
4,348 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); map<int, int> mp; for(int i = 0; i < 5; i++) { int a; cin >> a; mp[a]++; } bool two1 = false, two2 = false, three = false; for(auto i : mp) { if(i.second == 3) three = true; if(i.second == 2 && !two1) {two1 = true; continue;} if(i.second == 2 && two1) two2 = true; } if(three && two1) { cout << "FULL HOUSE" << endl; return 0; } if(three) { cout << "THREE CARD" << endl; return 0; } if(two1 && two2) { cout << "TWO PAIR" << endl; return 0; } if(two1) { cout << "ONE PAIR" << endl; return 0; } cout << "NO HAND" << endl; return 0; }