結果

問題 No.48 ロボットの操縦
ユーザー l1267976
提出日時 2017-03-09 15:25:08
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 532 bytes
コンパイル時間 4,093 ms
コンパイル使用メモリ 75,420 KB
実行使用メモリ 54,564 KB
最終ジャッジ日時 2024-06-24 00:05:36
合計ジャッジ時間 8,107 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 7
権限があれば一括ダウンロードができます

ソースコード

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