結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-26 13:40:01 |
| 言語 | PHP (843.2) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 1,000 ms |
| コード長 | 421 bytes |
| コンパイル時間 | 2,489 ms |
| コンパイル使用メモリ | 31,888 KB |
| 実行使用メモリ | 32,656 KB |
| 最終ジャッジ日時 | 2024-07-23 11:33:41 |
| 合計ジャッジ時間 | 1,438 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
/**
* No.143 豆
*
* @see https://yukicoder.me/problems/361
*/
list($numOfBeansPerBag, $numBag, $numPeopleOfFamily) = explode(" ", trim(fgets(STDIN)));
$ageList = explode(" ", trim(fgets(STDIN)));
$numToEatBeans = array_sum($ageList);
$numOfRemainingBeans = ($numOfBeansPerBag * $numBag) - $numToEatBeans;
if ($numOfRemainingBeans < 0) {
$numOfRemainingBeans = -1;
}
echo $numOfRemainingBeans . "\n";