結果
| 問題 | No.227 簡単ポーカー | 
| コンテスト | |
| ユーザー |  Div9851 | 
| 提出日時 | 2016-01-06 21:57:01 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 551 bytes | 
| コンパイル時間 | 1,269 ms | 
| コンパイル使用メモリ | 158,544 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-19 12:24:15 | 
| 合計ジャッジ時間 | 1,791 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d",&A);
      |         ~~~~~^~~~~~~~~
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
int cnt[14];
int main() {
    int A;
    for(int i=0;i<5;i++) {
        scanf("%d",&A);
        cnt[A]++;
    }
    int two=0,three=0;
    for(int i=1;i<=13;i++) {
        if(cnt[i]==2) two++;
        else if(cnt[i]==3) three++;
    }
    if(two==1&&three==1) {
        printf("FULL HOUSE\n");
    }else if(three==1) {
        printf("THREE CARD\n");
    }else if(two==2) {
        printf("TWO PAIR\n");
    }else if(two==1) {
        printf("ONE PAIR\n");
    }else {
        printf("NO HAND\n");
    }
}
            
            
            
        