結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー ree-rishun
提出日時 2020-05-18 04:25:44
言語 C(gnu17)
(gcc 15.3.0)
コンパイル:
gcc-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 270µs
コード長 634 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,355 ms
コンパイル使用メモリ 41,160 KB
実行使用メモリ 9,872 KB
最終ジャッジ日時 2026-11-12 01:24:47
合計ジャッジ時間 1,977 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>

int main() {
	
	int card[5];
	int number[13];

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

	for (int i = 0; i < 13; i++)
		number[i] = 0;
	
	for (int i = 0; i < 5; i++)
		number[card[i] - 1]++;

	int ans = 0;

	for (int i = 0; i < 13; i++) {
		if (number[i] == 3)
			ans += 3;
		else if (number[i] == 2)
			ans += 2;
	}

	switch (ans)
	{
	case 5:
		printf("FULL HOUSE");
		break;
	case 4:
		printf("TWO PAIR");
		break;
	case 3:
		printf("THREE CARD");
		break;
	case 2:
		printf("ONE PAIR");
		break;
	default:
		printf("NO HAND");
		break;
	}

	// 終了コードは0
	return 0;
}
0