結果

問題 No.365 ジェンガソート
ユーザー papinianuspapinianus
提出日時 2016-09-01 13:58:39
言語 PHP
(8.3.4)
結果
TLE  
実行時間 -
コード長 357 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 32,272 KB
実行使用メモリ 40,380 KB
最終ジャッジ日時 2024-04-27 14:10:24
合計ジャッジ時間 5,082 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
39,728 KB
testcase_01 AC 39 ms
32,404 KB
testcase_02 AC 39 ms
32,272 KB
testcase_03 AC 40 ms
32,216 KB
testcase_04 AC 39 ms
32,400 KB
testcase_05 AC 41 ms
32,272 KB
testcase_06 AC 40 ms
32,404 KB
testcase_07 AC 40 ms
32,276 KB
testcase_08 AC 40 ms
32,400 KB
testcase_09 AC 39 ms
32,404 KB
testcase_10 AC 39 ms
32,528 KB
testcase_11 AC 40 ms
32,144 KB
testcase_12 AC 40 ms
32,272 KB
testcase_13 AC 42 ms
32,400 KB
testcase_14 AC 40 ms
32,528 KB
testcase_15 AC 41 ms
32,528 KB
testcase_16 AC 504 ms
40,380 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$nums = explode(" ",trim(fgets(STDIN)));
$numstr = implode(" ", $nums);
sort($nums);
$act = 0;
$tail = strlen($numstr);
while(($num = array_pop($nums)) !== null) {
    $pos = strpos($numstr, $num);
    if($pos > $tail) {
        array_push($nums,$num);
        break;
    }
    $tail = $pos;
}
echo count($nums);
echo PHP_EOL;
0