結果
問題 | No.227 簡単ポーカー |
ユーザー | ococonomy1 |
提出日時 | 2018-09-01 02:36:19 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,657 bytes |
コンパイル時間 | 1,132 ms |
コンパイル使用メモリ | 30,464 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-09-14 02:20:32 |
合計ジャッジ時間 | 1,836 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
ソースコード
#include <stdio.h> int main(void){ int card[5],max,maxpoint,temp,onepairCheck = 0; for(int i = 0; i < 5; i++)scanf("%d",&card[i]); for(int i = 0; i < 5; i++){ max = 0; for(int j = i; j < 5; j++){ if(max < card[j]){ max = card[j]; maxpoint = j; } } temp = card[i]; card[i] = card[maxpoint]; card[maxpoint] = temp; } if(card[0] == card[1] && card[1] == card[2] && card[2] != card[3] && card[3] == card[4])printf("FULL HOUSE\n"); else if(card[0] == card[1] && card[1] != card[2] && card[2] == card[3] && card[3] == card[4])printf("FULL HOUSE\n"); else if(card[0] == card[1] && card[1] == card[2] && card[2] != card[3])printf("THREE CARD\n"); else if(card[1] == card[2] && card[2] == card[3] && card[2] != card[4])printf("THREE CARD\n"); else if(card[1] == card[2] && card[2] == card[3] && card[2] != card[0])printf("THREE CARD\n"); else if(card[2] == card[3] && card[3] == card[4] && card[4] != card[1])printf("THREE CARD\n"); else if(card[0] == card[1] && card[2] == card[3] && card[3] != card[4])printf("TWO PAIR\n"); else if(card[1] == card[2] && card[3] == card[4] && card[4] != card[0])printf("TWO PAIR\n"); else if(card[0] == card[1] && card[3] == card[4] && card[4] != card[0])printf("TWO PAIR\n"); else{ for(int i = 0; i < 4; i++){ if(card[i] == card[i + 1]){ int count = 0; for(int j = 0; j < 5; j++){ if(card[j] != card[i])count++; } if(count == 3){ printf("ONE PAIR\n"); onepairCheck = 1; break; } } } if(onepairCheck == 0)printf("NO HAND\n"); } return 0; }