結果

問題 No.51 やる気の問題
ユーザー togaerrortogaerror
提出日時 2015-04-08 15:03:50
言語 Perl
(5.38.2)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 210 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 5,100 KB
最終ジャッジ日時 2023-09-17 16:11:51
合計ジャッジ時間 1,570 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,000 KB
testcase_01 AC 5 ms
4,804 KB
testcase_02 AC 5 ms
4,868 KB
testcase_03 AC 6 ms
4,812 KB
testcase_04 AC 6 ms
5,072 KB
testcase_05 AC 24 ms
5,060 KB
testcase_06 AC 18 ms
4,808 KB
testcase_07 AC 18 ms
4,788 KB
testcase_08 AC 12 ms
5,100 KB
testcase_09 AC 33 ms
4,948 KB
testcase_10 AC 14 ms
4,792 KB
testcase_11 AC 12 ms
4,984 KB
testcase_12 AC 19 ms
5,060 KB
testcase_13 AC 20 ms
4,972 KB
testcase_14 AC 16 ms
5,032 KB
testcase_15 AC 27 ms
4,948 KB
testcase_16 AC 10 ms
5,004 KB
testcase_17 AC 7 ms
5,040 KB
testcase_18 AC 28 ms
4,988 KB
testcase_19 AC 29 ms
5,052 KB
testcase_20 AC 19 ms
4,952 KB
testcase_21 AC 7 ms
4,788 KB
testcase_22 AC 33 ms
5,064 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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