結果

問題 No.48 ロボットの操縦
ユーザー l1267976l1267976
提出日時 2017-03-09 15:25:08
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 532 bytes
コンパイル時間 4,682 ms
コンパイル使用メモリ 73,084 KB
実行使用メモリ 57,948 KB
最終ジャッジ日時 2023-09-06 05:23:48
合計ジャッジ時間 9,435 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,692 KB
testcase_01 AC 128 ms
55,896 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 125 ms
56,044 KB
testcase_05 AC 123 ms
55,864 KB
testcase_06 AC 124 ms
56,024 KB
testcase_07 AC 125 ms
55,508 KB
testcase_08 WA -
testcase_09 AC 123 ms
55,544 KB
testcase_10 WA -
testcase_11 AC 126 ms
55,696 KB
testcase_12 AC 125 ms
55,492 KB
testcase_13 AC 125 ms
56,080 KB
testcase_14 AC 125 ms
55,644 KB
testcase_15 AC 123 ms
55,748 KB
testcase_16 AC 125 ms
55,684 KB
testcase_17 AC 125 ms
55,976 KB
testcase_18 WA -
testcase_19 AC 122 ms
55,664 KB
testcase_20 AC 125 ms
55,692 KB
testcase_21 AC 125 ms
55,644 KB
testcase_22 WA -
testcase_23 AC 123 ms
55,904 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No48 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        int l = sc.nextInt();

        int cnt = 0;

        int xMove = Math.abs(x / l);
        if (x % l != 0) xMove++;
        cnt += xMove;

        if (xMove != 0) cnt++;

        int yMove = Math.abs(y / l);
        if (y % l != 0) yMove++;
        cnt += yMove;

        System.out.println(cnt);

        sc.close();
    }

}
0