結果

問題 No.98 円を描こう
ユーザー togaerrortogaerror
提出日時 2015-06-18 10:23:13
言語 Perl
(5.38.2)
結果
AC  
実行時間 5 ms / 5,000 ms
コード長 265 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 5,148 KB
最終ジャッジ日時 2023-09-21 09:25:20
合計ジャッジ時間 744 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,960 KB
testcase_01 AC 5 ms
5,076 KB
testcase_02 AC 5 ms
4,908 KB
testcase_03 AC 5 ms
4,960 KB
testcase_04 AC 5 ms
5,144 KB
testcase_05 AC 5 ms
5,148 KB
testcase_06 AC 5 ms
4,964 KB
testcase_07 AC 5 ms
4,832 KB
testcase_08 AC 5 ms
4,944 KB
testcase_09 AC 5 ms
4,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;

my ($xp, $yp) = split / /, <>;
my $ans;
my $r = sqrt($xp*$xp + $yp*$yp);
if($r == int $r) {	
	$ans = 2*(int $r) + 1;
} else {
	$ans = 2*((int $r) + 1);
}

for(my $i = $ans / 2; $i > $r; $i -= 0.5) {
	$ans = $i * 2;
}
print "$ans\n";
exit;
0