結果

問題 No.5 数字のブロック
コンテスト
ユーザー Ruizi_Luigi
提出日時 2015-07-24 11:24:31
言語 PHP
(8.5.4)
コンパイル:
php -l _filename_
実行:
php _filename_
結果
WA  
実行時間 -
コード長 262 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 80 ms
コンパイル使用メモリ 37,876 KB
実行使用メモリ 38,636 KB
最終ジャッジ日時 2026-03-30 06:47:21
合計ジャッジ時間 2,495 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 34
権限があれば一括ダウンロードができます
コンパイルメッセージ
PHP Deprecated:  Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 9

Deprecated: Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 9
PHP Deprecated:  Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 11

Deprecated: Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 11
No syntax errors detected in Main.php

ソースコード

diff #
raw source code

<?php

    $l = trim(fgets(STDIN));
    $n = trim(fgets(STDIN));
    $w = explode(' ', trim(fgets(STDIN)));
    asort($w);

    $sum = 0;
    for ($i = 0; $i < (integer)$n; $i++) {
    	$sum += $val;
    	if ($sum > (integer)$l) break;
    }

    echo $i . "\n";
0