結果

問題 No.48 ロボットの操縦
ユーザー Takeky0Takeky0
提出日時 2021-05-03 08:34:36
言語 Crystal
(1.11.2)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 22,817 ms
コンパイル使用メモリ 251,864 KB
実行使用メモリ 4,628 KB
最終ジャッジ日時 2023-09-29 02:51:15
合計ジャッジ時間 24,370 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,416 KB
testcase_01 AC 3 ms
4,484 KB
testcase_02 WA -
testcase_03 AC 3 ms
4,488 KB
testcase_04 AC 3 ms
4,412 KB
testcase_05 AC 2 ms
4,420 KB
testcase_06 AC 2 ms
4,560 KB
testcase_07 AC 2 ms
4,456 KB
testcase_08 AC 3 ms
4,508 KB
testcase_09 AC 3 ms
4,564 KB
testcase_10 AC 3 ms
4,556 KB
testcase_11 AC 3 ms
4,484 KB
testcase_12 AC 2 ms
4,396 KB
testcase_13 AC 3 ms
4,628 KB
testcase_14 AC 3 ms
4,416 KB
testcase_15 AC 2 ms
4,512 KB
testcase_16 AC 3 ms
4,488 KB
testcase_17 AC 2 ms
4,356 KB
testcase_18 AC 2 ms
4,488 KB
testcase_19 AC 2 ms
4,400 KB
testcase_20 AC 3 ms
4,424 KB
testcase_21 AC 3 ms
4,576 KB
testcase_22 AC 2 ms
4,552 KB
testcase_23 AC 2 ms
4,420 KB
testcase_24 AC 2 ms
4,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x=read_line.to_i
y=read_line.to_i
l=read_line.to_i
if x==0 & y>=0
    puts (y/l).ceil.to_i
else
    if y>=0
        puts ((y/l).ceil+(x/l).abs.ceil).to_i+1
    else
        puts ((y/l).abs.ceil+(x/l).abs.ceil).to_i+2
    end
end
0