結果

問題 No.620 ぐるぐるぐるりん
ユーザー tailstails
提出日時 2017-12-20 01:59:32
言語 Perl
(5.38.2)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 408 bytes
コンパイル時間 772 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 5,928 KB
最終ジャッジ日時 2023-09-03 21:24:57
合計ジャッジ時間 2,659 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,608 KB
testcase_01 AC 6 ms
5,624 KB
testcase_02 AC 6 ms
5,912 KB
testcase_03 AC 6 ms
5,844 KB
testcase_04 AC 6 ms
5,632 KB
testcase_05 AC 6 ms
5,928 KB
testcase_06 AC 6 ms
5,504 KB
testcase_07 AC 6 ms
5,904 KB
testcase_08 AC 6 ms
5,608 KB
testcase_09 AC 6 ms
5,852 KB
testcase_10 AC 6 ms
5,904 KB
testcase_11 AC 6 ms
5,692 KB
testcase_12 AC 6 ms
5,600 KB
testcase_13 AC 6 ms
5,736 KB
testcase_14 AC 6 ms
5,740 KB
testcase_15 AC 6 ms
5,668 KB
testcase_16 AC 6 ms
5,668 KB
testcase_17 AC 6 ms
5,684 KB
testcase_18 AC 6 ms
5,888 KB
testcase_19 AC 6 ms
5,820 KB
testcase_20 AC 6 ms
5,676 KB
testcase_21 AC 6 ms
5,672 KB
testcase_22 AC 6 ms
5,632 KB
testcase_23 AC 6 ms
5,588 KB
testcase_24 AC 5 ms
5,636 KB
testcase_25 AC 6 ms
5,504 KB
testcase_26 AC 41 ms
5,752 KB
testcase_27 AC 6 ms
5,188 KB
testcase_28 AC 42 ms
5,636 KB
testcase_29 AC 42 ms
5,736 KB
testcase_30 AC 41 ms
5,688 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::p" used only once: possible typo at Main.pl line 3.
Main.pl syntax OK

ソースコード

diff #

$n=<>;
for(1..$n){
	($t,$p,$w,$v,$gx,$gy)=glob<>;
	$v+=1;
	$r=sqrt($v*$v+$w*$w);
	$z=0;
	for(0..$t-1){
		$z+=($r**($t-1-$_))**2
	}
	$a=atan2($w,$v);
	{
		$c=cos($a*$t);
		$s=sin($a*$t);
		$dx=($gx-$c*$r**$t)/$z;
		$dy=($gy-$s*$r**$t)/$z;
	}
	for(0..$t-1){
		$c=cos($a*($_-($t-1)));
		$s=sin($a*($_-($t-1)));
		$x=($dx*$c-$dy*$s)*$r**($t-1-$_);
		$y=($dx*$s+$dy*$c)*$r**($t-1-$_);
		print $x," ",$y,"\n";
	}
}
0