結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,860 KB
testcase_01 AC 5 ms
5,056 KB
testcase_02 AC 5 ms
4,868 KB
testcase_03 AC 6 ms
5,044 KB
testcase_04 AC 5 ms
5,044 KB
testcase_05 AC 25 ms
5,100 KB
testcase_06 AC 18 ms
4,804 KB
testcase_07 AC 18 ms
4,784 KB
testcase_08 AC 12 ms
4,872 KB
testcase_09 AC 33 ms
4,932 KB
testcase_10 AC 14 ms
4,796 KB
testcase_11 AC 12 ms
5,092 KB
testcase_12 AC 20 ms
4,804 KB
testcase_13 AC 20 ms
4,988 KB
testcase_14 AC 17 ms
4,804 KB
testcase_15 AC 27 ms
5,092 KB
testcase_16 AC 11 ms
4,912 KB
testcase_17 AC 7 ms
4,788 KB
testcase_18 AC 28 ms
5,060 KB
testcase_19 AC 29 ms
4,812 KB
testcase_20 AC 19 ms
4,864 KB
testcase_21 AC 7 ms
5,080 KB
testcase_22 AC 33 ms
5,072 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/uer/bin/perl

use strict;
use warnings;

my $w = <>;
my $d = <>;
my $ans;
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