結果

問題 No.5 数字のブロック
ユーザー kagikakko_karikagikakko_kari
提出日時 2016-06-19 19:22:54
言語 PHP
(8.3.4)
結果
OLE  
実行時間 -
コード長 266 bytes
コンパイル時間 5,047 ms
コンパイル使用メモリ 30,612 KB
実行使用メモリ 64,640 KB
最終ジャッジ日時 2024-04-19 20:37:05
合計ジャッジ時間 12,752 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
31,364 KB
testcase_01 AC 34 ms
31,200 KB
testcase_02 AC 33 ms
31,044 KB
testcase_03 AC 37 ms
31,376 KB
testcase_04 AC 39 ms
31,188 KB
testcase_05 AC 41 ms
31,372 KB
testcase_06 AC 38 ms
31,480 KB
testcase_07 AC 38 ms
31,640 KB
testcase_08 AC 38 ms
31,244 KB
testcase_09 AC 36 ms
31,348 KB
testcase_10 AC 41 ms
32,140 KB
testcase_11 AC 38 ms
31,576 KB
testcase_12 AC 38 ms
31,376 KB
testcase_13 AC 40 ms
31,372 KB
testcase_14 AC 34 ms
31,040 KB
testcase_15 AC 35 ms
31,308 KB
testcase_16 AC 40 ms
31,372 KB
testcase_17 AC 42 ms
32,012 KB
testcase_18 AC 40 ms
31,888 KB
testcase_19 AC 41 ms
32,016 KB
testcase_20 OLE -
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 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$l = trim(fgets(STDIN));
$n = trim(fgets(STDIN));
if($n == 1){
$w = trim(fgets(STDIN));
if($l >= $w){
echo "1\n";
}else{
echo "0\n";
}
}else{
$w = explode(" ",trim(fgets(STDIN)));
sort($w);
for($i = 0;$w[$i] <= $l;$i++){
$w[$i + 1] += $w[$i];
}
echo $i."\n";
}
0