結果

問題 No.365 ジェンガソート
ユーザー papinianuspapinianus
提出日時 2016-09-01 13:49:28
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 32,272 KB
実行使用メモリ 42,808 KB
最終ジャッジ日時 2024-04-27 14:10:04
合計ジャッジ時間 4,661 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
32,276 KB
testcase_01 AC 40 ms
32,272 KB
testcase_02 AC 40 ms
32,272 KB
testcase_03 AC 41 ms
32,400 KB
testcase_04 AC 40 ms
32,144 KB
testcase_05 AC 41 ms
32,272 KB
testcase_06 AC 41 ms
32,272 KB
testcase_07 AC 40 ms
32,272 KB
testcase_08 AC 40 ms
32,400 KB
testcase_09 AC 41 ms
32,272 KB
testcase_10 AC 41 ms
32,148 KB
testcase_11 AC 40 ms
32,148 KB
testcase_12 AC 40 ms
32,272 KB
testcase_13 AC 41 ms
32,404 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 119 ms
40,632 KB
testcase_23 AC 87 ms
36,408 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 95 ms
36,412 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 101 ms
36,540 KB
testcase_31 AC 66 ms
34,360 KB
testcase_32 WA -
testcase_33 AC 151 ms
42,552 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 147 ms
42,608 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 = $n;
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