結果

問題 No.2516 Credit Creation
ユーザー k k
提出日時 2023-11-19 11:13:56
言語 PHP
(843.2)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 1,691 ms
コンパイル使用メモリ 32,144 KB
実行使用メモリ 31,424 KB
最終ジャッジ日時 2024-09-26 06:15:06
合計ジャッジ時間 2,517 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$input = multi_line();

$bank_count = $input[0];
$avg = $input[1];
$beep = 100;
$result = $beep;

for($i=1; $i<$bank_count; $i++) {
    $result += $beep * (1 - $avg);
    $beep = $beep * (1 - $avg);
}

echo $result;


function multi_line() {
    $input = [];
    while ($line = fgets(STDIN)) {
        $input[] = trim($line);
    }
    return $input;
}
0