結果

問題 No.227 簡単ポーカー
ユーザー regulusregulus
提出日時 2017-11-21 18:43:06
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 536 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 29,172 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-17 11:52:58
合計ジャッジ時間 1,061 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define F(i,n) for(int i = 0;i < n;i++)
#include <stdio.h>
void x(int a[],int b[],int n){int c[14]={0};int ct=0;F(i,n){c[a[i]]++;}F(i,14){if(c[i] != 0){for(int i2 = 0;i2 < c[i];i2++){b[ct] = i;ct++;}}}}
int main(void){int t=0; int s=0;int a[9]={0};F(i,5)scanf("%d",&a[i]);x(a,a,5);F(i,4){if(a[0]==a[3]||a[0]==a[4])break;if(a[i] == a[i+1]){if(a[i]==a[i+2])t=1;else s++;a[i+1]=0;}}if(t==1&&s==1)puts("FULL HOUSE");else if(t==1)puts("THREE CARD");else if(s==2)puts("TWO PAIR");else if(s==1)puts("ONE PAIR");else puts("NO HAND");return 0;}
0