結果
| 問題 | No.227 簡単ポーカー |
| コンテスト | |
| ユーザー |
toto
|
| 提出日時 | 2025-03-27 16:49:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 632 bytes |
| コンパイル時間 | 355 ms |
| コンパイル使用メモリ | 27,904 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2025-03-27 16:49:43 |
| 合計ジャッジ時間 | 1,380 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d",&tmp);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
// カードの種類
int card[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
for(int i = 0;i < 5;i ++){
int tmp = 0;
scanf("%d",&tmp);
card[tmp - 1]++;
}
// 3枚ペアと2枚ペアがそれぞれ何組あるか
int count2 = 0;
int count3 = 0;
for(int i = 0;i < 13;i ++){
if(card[i] == 2){
count2++;
}else if(card[i] == 3){
count3++;
}
}
if(count3 == 1 && count2 == 1){
printf("FULL HOUSE");
}else if(count3 == 1 && count2 == 0){
printf("THREE CARD");
}else if(count2 == 2){
printf("TWO PAIR");
}else if(count2 == 1){
printf("ONE PAIR");
}else{
printf("NO HAND");
}
}
toto