結果

問題 No.5 数字のブロック
ユーザー 綾地寧々綾地寧々
提出日時 2015-04-28 15:07:25
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 1,161 ms
コンパイル使用メモリ 18,448 KB
実行使用メモリ 19,140 KB
最終ジャッジ日時 2023-09-18 14:04:14
合計ジャッジ時間 3,116 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,916 KB
testcase_01 AC 15 ms
18,916 KB
testcase_02 WA -
testcase_03 AC 20 ms
18,652 KB
testcase_04 AC 18 ms
18,828 KB
testcase_05 AC 21 ms
18,688 KB
testcase_06 AC 18 ms
18,860 KB
testcase_07 AC 19 ms
18,796 KB
testcase_08 AC 19 ms
18,596 KB
testcase_09 AC 16 ms
18,864 KB
testcase_10 AC 22 ms
18,768 KB
testcase_11 AC 18 ms
18,840 KB
testcase_12 AC 20 ms
18,628 KB
testcase_13 AC 21 ms
18,768 KB
testcase_14 AC 15 ms
18,684 KB
testcase_15 AC 15 ms
18,624 KB
testcase_16 AC 22 ms
18,628 KB
testcase_17 AC 23 ms
18,812 KB
testcase_18 AC 22 ms
18,612 KB
testcase_19 AC 22 ms
18,708 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 15 ms
18,784 KB
testcase_24 AC 15 ms
18,828 KB
testcase_25 AC 16 ms
18,900 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 18 ms
18,756 KB
testcase_30 AC 17 ms
18,844 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

$boxsize = fgets(STDIN);
$blocknum = fgets(STDIN);
$blocks = explode(" ",fgets(STDIN));

$res = sort($blocks, $sort_flags = SORT_NUMERIC);

$insize = 0;
foreach ( $blocks as $inblock => $blocksize ) {
	if ( ($insize+$blocksize) > $boxsize ) {
		break;
	}
	$insize += $blocksize;
}

echo $inblock ."\n";
0