結果

問題 No.587 七対子
ユーザー PicklesSuperiorPicklesSuperior
提出日時 2018-10-15 04:25:35
言語 PHP
(8.3.4)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 853 bytes
コンパイル時間 1,437 ms
コンパイル使用メモリ 12,012 KB
実行使用メモリ 12,336 KB
最終ジャッジ日時 2023-09-27 02:26:12
合計ジャッジ時間 2,530 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,276 KB
testcase_01 AC 7 ms
12,208 KB
testcase_02 AC 7 ms
12,268 KB
testcase_03 AC 7 ms
12,156 KB
testcase_04 AC 7 ms
12,156 KB
testcase_05 AC 7 ms
12,320 KB
testcase_06 AC 7 ms
12,256 KB
testcase_07 AC 7 ms
12,268 KB
testcase_08 AC 7 ms
12,272 KB
testcase_09 AC 7 ms
12,252 KB
testcase_10 AC 7 ms
12,288 KB
testcase_11 AC 7 ms
12,256 KB
testcase_12 AC 7 ms
12,252 KB
testcase_13 AC 7 ms
12,232 KB
testcase_14 AC 7 ms
12,188 KB
testcase_15 AC 7 ms
12,248 KB
testcase_16 AC 8 ms
12,320 KB
testcase_17 AC 7 ms
12,268 KB
testcase_18 AC 7 ms
12,244 KB
testcase_19 AC 7 ms
12,336 KB
testcase_20 AC 7 ms
12,248 KB
testcase_21 AC 7 ms
12,252 KB
testcase_22 AC 7 ms
12,204 KB
testcase_23 AC 7 ms
12,252 KB
testcase_24 AC 7 ms
12,272 KB
testcase_25 AC 7 ms
12,276 KB
testcase_26 AC 7 ms
12,316 KB
testcase_27 AC 7 ms
12,328 KB
testcase_28 AC 7 ms
12,244 KB
testcase_29 AC 7 ms
12,280 KB
testcase_30 AC 7 ms
12,316 KB
testcase_31 AC 7 ms
12,164 KB
testcase_32 AC 7 ms
12,248 KB
testcase_33 AC 7 ms
12,184 KB
testcase_34 AC 7 ms
12,336 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 = $pool[$i][0];
        }
        print $ans . "\n";
    }
?>
0