結果

問題 No.390 最長の数列
ユーザー kagikakko_karikagikakko_kari
提出日時 2016-07-09 16:07:00
言語 PHP
(8.3.4)
結果
TLE  
実行時間 -
コード長 319 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 31,160 KB
実行使用メモリ 30,932 KB
最終ジャッジ日時 2024-04-21 10:43:41
合計ジャッジ時間 6,849 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
30,932 KB
testcase_01 AC 40 ms
30,920 KB
testcase_02 AC 40 ms
30,800 KB
testcase_03 AC 38 ms
30,808 KB
testcase_04 AC 38 ms
30,776 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$N = trim(fgets(STDIN));
$x = explode(" ",trim(fgets(STDIN)));
rsort($x);
$ans = array();
$ans = array_pad($ans,$N,0);

for($i = 0;$i < $N;$i++){
    for($j = $i;$j < $N;$j++){
        if($x[$i] % $x[$j] == 0){
            $ans[$i] ++;
        }
    }
}
$ans = array_count_values($ans);
echo count($ans) ."\n";
?>
0