結果

問題 No.48 ロボットの操縦
ユーザー kuroi_13kuroi_13
提出日時 2017-01-26 10:21:12
言語 Perl
(5.38.0)
結果
AC  
実行時間 5 ms / 5,000 ms
コード長 320 bytes
コンパイル時間 536 ms
コンパイル使用メモリ 7,032 KB
実行使用メモリ 5,036 KB
最終ジャッジ日時 2023-08-24 23:18:19
合計ジャッジ時間 1,223 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,036 KB
testcase_01 AC 5 ms
4,948 KB
testcase_02 AC 5 ms
4,904 KB
testcase_03 AC 5 ms
4,836 KB
testcase_04 AC 5 ms
4,888 KB
testcase_05 AC 5 ms
4,980 KB
testcase_06 AC 5 ms
4,888 KB
testcase_07 AC 5 ms
4,896 KB
testcase_08 AC 4 ms
4,956 KB
testcase_09 AC 5 ms
4,832 KB
testcase_10 AC 5 ms
5,020 KB
testcase_11 AC 5 ms
4,840 KB
testcase_12 AC 4 ms
4,808 KB
testcase_13 AC 4 ms
4,948 KB
testcase_14 AC 5 ms
4,892 KB
testcase_15 AC 5 ms
5,004 KB
testcase_16 AC 5 ms
4,832 KB
testcase_17 AC 5 ms
4,812 KB
testcase_18 AC 5 ms
5,024 KB
testcase_19 AC 4 ms
5,008 KB
testcase_20 AC 5 ms
4,940 KB
testcase_21 AC 5 ms
4,904 KB
testcase_22 AC 5 ms
4,888 KB
testcase_23 AC 5 ms
4,900 KB
testcase_24 AC 5 ms
5,012 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use strict;
use warnings;

my @in = (0) x 3;
for(0..2){
    $in[$_] = <STDIN>;
}

my $num = $in[1] < 0 ? 2 : $in[0] == 0 ? 0 : 1;
$in[0] = abs($in[0]); $in[1] = abs($in[1]);
$num += $in[0]%$in[2] == 0 ? $in[0]/$in[2] : int($in[0]/$in[2])+1;
$num += $in[1]%$in[2] == 0 ? $in[1]/$in[2] : int($in[1]/$in[2])+1;

print $num;
0