結果

問題 No.128 お年玉(1)
ユーザー togaerror
提出日時 2015-03-18 21:34:16
言語 Perl
(5.40.0)
結果
AC  
実行時間 6 ms / 5,000 ms
コード長 233 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 6,016 KB
最終ジャッジ日時 2024-10-01 09:50:44
合計ジャッジ時間 992 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/perl

use strict;
use warnings;

my $n = <>;
my $m = <>;

$n /= 1000;
$n = int $n;
my $ans;
if($n < $m) {
	$ans = 0;
} else {
	$ans = $n % $m;
	$ans = $n - $ans;
	$ans = $ans / $m;
	$ans *= 1000;
}

print "$ans\n";

exit;
0