結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2015-03-16 01:51:04 |
言語 | PHP (843.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 511 bytes |
コンパイル時間 | 218 ms |
コンパイル使用メモリ | 32,532 KB |
実行使用メモリ | 32,656 KB |
最終ジャッジ日時 | 2024-06-28 23:01:00 |
合計ジャッジ時間 | 2,418 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 34 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
$box_width = trim(fgets(STDIN)); $block_num = trim(fgets(STDIN)); $block_width_array = explode(" ", fgets(STDIN)); $block_width_array = str_replace(array("\r\n", "\r", "\n"), "", $block_width_array); //echo $box_width."\n"; //echo $block_num."\n"; //print_r($block_width_array); sort($block_width_array); //print_r($block_width_array); $result = 0; $count = 0; for($i=0; $i<$block_num; $i++){ $result += $block_width_array[$i]; if($result > $box_width){ break; } $count++; } echo $count;