結果

問題 No.32 貯金箱の憂鬱
コンテスト
ユーザー beatdjam
提出日時 2016-09-30 10:23:02
言語 PHP
(8.5.9)
コンパイル:
php -l _filename_
実行:
php _filename_
結果
AC  
実行時間 33 ms / 5,000 ms
+ 212µs
コード長 641 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,519 ms
コンパイル使用メモリ 36,500 KB
実行使用メモリ 37,008 KB
最終ジャッジ日時 2026-08-23 17:12:28
合計ジャッジ時間 1,623 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #
raw source code

<?php
    $input_lines = trim(fgets(STDIN));
    $input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);
    do {
        $tmpStr[] = $input_lines;
        $input_lines = trim(fgets(STDIN));
        $input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);
    } while ($input_lines !== "");
    
    $tmpVal = $tmpStr[0] * 100;
    $tmpVal += $tmpStr[1] * 25;
    $tmpVal += $tmpStr[2];
    
    $tmpVal = $tmpVal % 1000;
    
    $tmpCnt = floor($tmpVal / 100);
    $tmpVal = $tmpVal % 100;
    
    $tmpCnt += floor($tmpVal / 25);
    $tmpVal = $tmpVal % 25;
    
    $tmpCnt += $tmpVal;
    
    echo $tmpCnt;
0