結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-03-12 03:02:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 614 bytes |
| コンパイル時間 | 316 ms |
| コンパイル使用メモリ | 39,880 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-06 07:02:53 |
| 合計ジャッジ時間 | 1,013 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d %d %d %d %d", A, A + 1, A + 2, A + 3, A + 4);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;
//227
int main() {
int A[5], carry = 1;
scanf("%d %d %d %d %d", A, A + 1, A + 2, A + 3, A + 4);
sort(A, A + 5);
int Pairs[6] = { 0 };
for (int i = 1; i < 5; i++) {
if (A[i] == A[i - 1])
carry++;
else {
Pairs[carry]++;
carry = 1;
}
}
Pairs[carry]++;
if (Pairs[2] == 1 && Pairs[3] == 1)
printf("FULL HOUSE\n");
else if (Pairs[3] == 1)
printf("THREE CARD\n");
else if (Pairs[2] == 2)
printf("TWO PAIR\n");
else if (Pairs[2] == 1)
printf("ONE PAIR\n");
else
printf("NO HAND\n");
}
AQUA16573837