結果

問題 No.365 ジェンガソート
ユーザー papinianus
提出日時 2016-09-01 13:49:28
言語 PHP
(843.2)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 32,144 KB
実行使用メモリ 42,868 KB
最終ジャッジ日時 2024-11-15 16:40:52
合計ジャッジ時間 4,759 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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