結果

問題 No.542 1円玉と5円玉
ユーザー しめはじめしめはじめ
提出日時 2019-06-20 11:36:32
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 1,005 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 12,368 KB
最終ジャッジ日時 2023-08-22 09:29:27
合計ジャッジ時間 2,362 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,220 KB
testcase_01 AC 7 ms
12,336 KB
testcase_02 WA -
testcase_03 AC 7 ms
12,288 KB
testcase_04 AC 7 ms
12,240 KB
testcase_05 AC 8 ms
12,180 KB
testcase_06 AC 8 ms
12,284 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 7 ms
12,292 KB
testcase_12 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$data = explode( " ", trim( fgets( STDIN ) ) );
$ichien = $data[0];
$goen = $data[1];
// 最大でいくらになるか
$max = $goen * 5 + $ichien;
// 1円の最大端数を得る
$komakaino = $ichien % 5;
// あり得る場合だけ出力
for( $i = 1; $i <= $max; $i++ ){
    if( $i % 5 <= $komakaino ){
        printf( "%d\n", $i );
    }
}
0