結果

問題 No.227 簡単ポーカー
ユーザー N/AN/A
提出日時 2018-06-17 22:02:32
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 1,228 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 29,216 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 06:27:03
合計ジャッジ時間 1,089 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 0 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 0 ms
4,380 KB
testcase_09 AC 0 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// No.227 ȒP|[J[

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(void) {
	int a[5];
	int i, j, k, m;
	int n[13] = { 0 };
	int trp = 0, dbl = 0;

	scanf("%d %d %d %d %d", &a[0], &a[1], &a[2], &a[3], &a[4]);

	for (j = 0; j < 5; j++) {
		switch (a[j]) {
		case 1:
			n[0]++;
			break;

		case 2:
			n[1]++;
			break;

		case 3:
			n[2]++;
			break;

		case 4:
			n[3]++;
			break;

		case 5:
			n[4]++;
			break;

		case 6:
			n[5]++;
			break;

		case 7:
			n[6]++;
			break;

		case 8:
			n[7]++;
			break;

		case 9:
			n[8]++;
			break;

		case 10:
			n[9]++;
			break;

		case 11:
			n[10]++;
			break;

		case 12:
			n[11]++;
			break;

		case 13:
			n[12]++;
			break;
		}
	}

	// printf("%d %d %d %d %d\n", n[4], n[5], n[6], n[7], n[8], n[9]);

	for (m = 0; m <= 12; m++) {
		if (n[m] == 3) {
			trp++;
		}
		else if (n[m] == 2) {
			dbl++;
		}

	}

	if (trp == 1 && dbl == 1) {
		printf("FULL HOUSE\n");
	}
	else if (trp == 1) {
		printf("THREE CARD\n");
	}
	else if (dbl == 2) {
		printf("TWO PAIR\n");
	}
	else if (dbl == 1) {
		printf("ONE PAIR\n");
	}
	else {
		printf("NO HAND\n");
	}

	return 0;
}
0