結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2019-07-06 00:47:44 |
言語 | Perl (5.40.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 576 bytes |
コンパイル時間 | 113 ms |
コンパイル使用メモリ | 6,688 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-22 13:28:18 |
合計ジャッジ時間 | 934 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
my $X = <>;my $Y = <>;my $K = <>;#to make a positive numbermy $pX = sqrt($X*$X);my $pY = sqrt($Y*$Y);my $remainder_x = $pX % $K;my $count_x = ($pX - $remainder_x)/$K;my $remainder_y = $pY % $K;my $count_y = ($pY - $remainder_y)/$K;my $count;if($remainder_x != 0 && $remainder_y != 0){$count = 2;}elsif($remainder_x != 0 || $remainder_y != 0){$count = 1;}else{$count = 0;}my $turn;if($X == 0 && $Y > 0){$turn = 0;}elsif($Y < 0){$turn = 2;}else{$turn = 1;}my $ans = $count + $count_x + $count_y + $turn;print "$ans\n";