結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
Ruizi_Luigi
|
| 提出日時 | 2015-07-24 11:20:14 |
| 言語 | PHP (8.5.4) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 305 bytes |
| 記録 | |
| コンパイル時間 | 128 ms |
| コンパイル使用メモリ | 38,144 KB |
| 実行使用メモリ | 38,520 KB |
| 最終ジャッジ日時 | 2026-05-12 16:26:02 |
| 合計ジャッジ時間 | 2,738 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 34 |
コンパイルメッセージ
PHP Deprecated: Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 12 Deprecated: Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 12 PHP Deprecated: Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 12 Deprecated: Non-canonical cast (integer) is deprecated, use the (int) cast instead in Main.php on line 12 No syntax errors detected in Main.php
ソースコード
<?php
$l = trim(fgets(STDIN));
$n =trim(fgets(STDIN));
$w = explode(' ', trim(fgets(STDIN)));
asort($w);
$count = 0;
$sum = 0;
foreach ($w as $val) {
$sum += $val;
if ($sum > (integer)$l || $count >= (integer)$n) break;
$count++;
}
echo $count . "\n";
Ruizi_Luigi