結果

問題 No.48 ロボットの操縦
ユーザー shiCanoko_oshiCanoko_o
提出日時 2019-06-06 23:20:32
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 322 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 6,948 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-09 21:04:35
合計ジャッジ時間 938 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,816 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 WA -
testcase_03 AC 3 ms
6,940 KB
testcase_04 WA -
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 3 ms
6,944 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
6,940 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 3 ms
6,944 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 3 ms
6,940 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

my $X = <>;
my $Y = <>;
my $K = <>;

#to make a positive number
my $pX = sqrt($X*$X);
my $pY = sqrt($Y*$Y);

my $remainder = ($pX+$pY) % $K;
my $count = ($pX + $pY - $remainder)/$K;

if (0 == $X){
    print "$count\n";
}elsif (0 < $X){
    $count += 1;
    print "$count\n";
}else{
    $count += 2;
    print "$count\n";
}
0