結果

問題 No.48 ロボットの操縦
ユーザー Hiroaki KonoHiroaki Kono
提出日時 2017-10-26 22:53:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 492 bytes
コンパイル時間 3,071 ms
コンパイル使用メモリ 75,140 KB
実行使用メモリ 41,692 KB
最終ジャッジ日時 2024-05-01 15:19:47
合計ジャッジ時間 6,948 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
41,084 KB
testcase_01 AC 114 ms
41,120 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 113 ms
40,016 KB
testcase_05 AC 120 ms
41,268 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 114 ms
41,024 KB
testcase_21 AC 120 ms
41,040 KB
testcase_22 WA -
testcase_23 AC 96 ms
39,540 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.text.DecimalFormat;
import java.util.Scanner;

public class No48 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int x = Math.abs(s.nextInt());
        int y = Math.abs(s.nextInt());
        int l = s.nextInt();
        int turn = x != 0 && y != 0 ? 1 : 0;
        String steps = new DecimalFormat("")
            .format(Math.ceil((double) x / l) + Math.ceil((double) y / l) + turn);
        System.out.println(steps);
    }
}
0