結果

問題 No.587 七対子
ユーザー PicklesSuperiorPicklesSuperior
提出日時 2018-10-15 04:14:51
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 851 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 32,276 KB
実行使用メモリ 32,404 KB
最終ジャッジ日時 2024-04-20 20:23:10
合計ジャッジ時間 2,210 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
32,084 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 35 ms
32,272 KB
testcase_06 AC 36 ms
32,276 KB
testcase_07 AC 37 ms
32,272 KB
testcase_08 AC 36 ms
32,276 KB
testcase_09 AC 36 ms
32,212 KB
testcase_10 AC 35 ms
32,016 KB
testcase_11 AC 37 ms
32,272 KB
testcase_12 WA -
testcase_13 AC 37 ms
31,892 KB
testcase_14 AC 36 ms
32,276 KB
testcase_15 AC 36 ms
32,148 KB
testcase_16 AC 35 ms
32,276 KB
testcase_17 AC 35 ms
32,144 KB
testcase_18 AC 36 ms
32,272 KB
testcase_19 AC 36 ms
32,016 KB
testcase_20 AC 34 ms
32,404 KB
testcase_21 AC 35 ms
32,276 KB
testcase_22 AC 34 ms
32,272 KB
testcase_23 AC 33 ms
32,216 KB
testcase_24 AC 35 ms
32,020 KB
testcase_25 AC 36 ms
32,272 KB
testcase_26 AC 36 ms
32,276 KB
testcase_27 AC 35 ms
32,276 KB
testcase_28 AC 36 ms
32,212 KB
testcase_29 AC 36 ms
32,144 KB
testcase_30 AC 36 ms
32,400 KB
testcase_31 AC 36 ms
32,400 KB
testcase_32 WA -
testcase_33 AC 36 ms
32,276 KB
testcase_34 AC 37 ms
32,276 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

    $input = fgets(STDIN);
    $pool = array();
    $flag = "EMPTY";
    $pool_count = 0;
    $ans;

    for($i=0 ; $i<13 ; $i++){
        for($j=0 ; $j<$pool_count ; $j++){
            if($pool[$j][0] == $input[$i]){
                $pool[$j][1] += 1;
                $flag = "IN";
                break;
            }
        }
        if($flag == "EMPTY"){
            $pool[$pool_count][0] = $input[$i];
            $pool[$pool_count][1] = 1;
            $pool_count += 1;
        }
        $flag = "EMPTY";
    }


    if($pool_count != 7){
        print("Impossible\n");
    }else{
        for($i=0 ; $i<$pool_count ; $i++){
            if($pool[$i][1] > 2){
                print "Impossible" . "\n";
                return;
            }
            if($pool[$i][1] == 1) $ans = $input[$i];
        }
        print $ans . "\n";
    }
?>
0