結果

問題 No.51 やる気の問題
ユーザー togaerror
提出日時 2015-04-08 15:03:50
言語 Perl
(5.40.0)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 210 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 5,760 KB
最終ジャッジ日時 2024-07-04 11:05:59
合計ジャッジ時間 1,298 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/uer/bin/perl

use strict;
use warnings;

my $w = <>;
my $d = <>;
for(my $i = 0; $i < $d; $i++) {
	my $ans = $w / ($d - $i)**2;
	$ans = int $ans;
	$w -= $ans;
	if($d - $i == 1) {
		print "$ans\n";
	}
}

exit;
0