結果

問題 No.227 簡単ポーカー
ユーザー tazakkytazakky
提出日時 2017-09-08 22:18:13
言語 PHP
(8.3.4)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 621 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 30,832 KB
実行使用メモリ 31,204 KB
最終ジャッジ日時 2024-04-24 20:25:31
合計ジャッジ時間 1,318 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
30,632 KB
testcase_01 AC 41 ms
31,028 KB
testcase_02 AC 41 ms
31,004 KB
testcase_03 AC 42 ms
31,100 KB
testcase_04 AC 40 ms
30,900 KB
testcase_05 AC 41 ms
30,712 KB
testcase_06 AC 40 ms
31,064 KB
testcase_07 AC 40 ms
30,940 KB
testcase_08 AC 40 ms
30,972 KB
testcase_09 AC 41 ms
31,140 KB
testcase_10 AC 40 ms
31,052 KB
testcase_11 AC 40 ms
31,172 KB
testcase_12 AC 41 ms
31,204 KB
testcase_13 AC 41 ms
30,996 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    // 5枚のカードが配られます。
    $cards = explode(" ",trim(fgets(STDIN)));
    //print_r( array_count_values($cards) );
    
    if(in_array(2,array_count_values($cards)) && in_array(3,array_count_values($cards))){
        echo "FULL HOUSE\n";
    }elseif(max(array_count_values($cards)) == 3){
        echo "THREE CARD\n";
    }elseif(max(array_count_values($cards)) == 2 && array_count_values(array_count_values($cards))[2] == 2){
        echo "TWO PAIR\n";  
    }elseif(in_array(2,array_count_values($cards))){
        echo "ONE PAIR\n";
    }else{
        echo "NO HAND\n";
    }
    
    

?>
0