結果

問題 No.587 七対子
ユーザー PicklesSuperiorPicklesSuperior
提出日時 2018-10-15 04:13:36
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 851 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 12,080 KB
実行使用メモリ 12,352 KB
最終ジャッジ日時 2023-08-02 20:14:13
合計ジャッジ時間 1,715 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
12,232 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 8 ms
12,248 KB
testcase_06 AC 7 ms
12,272 KB
testcase_07 AC 7 ms
12,256 KB
testcase_08 AC 7 ms
12,240 KB
testcase_09 AC 7 ms
12,300 KB
testcase_10 AC 8 ms
12,172 KB
testcase_11 AC 8 ms
12,232 KB
testcase_12 WA -
testcase_13 AC 8 ms
12,224 KB
testcase_14 AC 7 ms
12,260 KB
testcase_15 AC 8 ms
12,240 KB
testcase_16 AC 7 ms
12,272 KB
testcase_17 AC 7 ms
12,324 KB
testcase_18 AC 7 ms
12,184 KB
testcase_19 AC 7 ms
12,236 KB
testcase_20 AC 7 ms
12,208 KB
testcase_21 AC 7 ms
12,300 KB
testcase_22 AC 7 ms
12,148 KB
testcase_23 AC 7 ms
12,204 KB
testcase_24 AC 7 ms
12,144 KB
testcase_25 AC 7 ms
12,204 KB
testcase_26 AC 8 ms
12,276 KB
testcase_27 AC 7 ms
12,276 KB
testcase_28 AC 7 ms
12,172 KB
testcase_29 AC 7 ms
12,172 KB
testcase_30 AC 8 ms
12,200 KB
testcase_31 AC 7 ms
12,184 KB
testcase_32 WA -
testcase_33 AC 8 ms
12,184 KB
testcase_34 AC 7 ms
12,152 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