結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
Ruizi_Luigi
|
| 提出日時 | 2015-07-24 11:21:59 |
| 言語 | PHP (8.5.9) |
| 結果 |
WA
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 304 bytes |
| 記録 | |
| コンパイル時間 | 592 ms |
| コンパイル使用メモリ | 38,108 KB |
| 実行使用メモリ | 38,744 KB |
| 最終ジャッジ日時 | 2026-09-25 14:26:17 |
| 合計ジャッジ時間 | 2,952 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_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