結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
Ruizi_Luigi
|
| 提出日時 | 2015-07-24 11:21:59 |
| 言語 | PHP (8.5.4) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 304 bytes |
| 記録 | |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 36,396 KB |
| 実行使用メモリ | 37,612 KB |
| 最終ジャッジ日時 | 2026-05-12 16:26:48 |
| 合計ジャッジ時間 | 2,535 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)));
sort($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