結果

問題 No.620 ぐるぐるぐるりん
ユーザー tails
提出日時 2017-12-20 01:15:06
言語 Perl
(5.40.0)
結果
WA  
実行時間 -
コード長 389 bytes
コンパイル時間 921 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-12-16 02:49:48
合計ジャッジ時間 4,983 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::p" used only once: possible typo at Main.pl line 4.
Name "main::q" used only once: possible typo at Main.pl line 3.
Main.pl syntax OK

ソースコード

diff #

$n=<>;
for(1..$n){
$q=0;
	($t,$p,$w,$v,$gx,$gy)=glob<>;
	$v+=1;
	$r=sqrt($v*$v+$w*$w);
	if($r==1){
		$z=$t;
	}else{
		$z=($r**$t-1)/($r-1);
	}
	$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;
		$y=$dx*$s+$dy*$c;
		print $x," ",$y,"\n";
	}
}
0