結果

問題 No.48 ロボットの操縦
ユーザー tenten
提出日時 2020-11-10 12:22:19
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 2,326 ms
コンパイル使用メモリ 74,284 KB
実行使用メモリ 41,616 KB
最終ジャッジ日時 2024-07-22 17:23:47
合計ジャッジ時間 6,488 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = Math.abs(sc.nextInt());
        int y = sc.nextInt();
        int k = sc.nextInt();
        int ans = 0;
        if (y < 0) {
            ans++;
            y = -y;
        }
        ans += (y + k - 1) / k;
        if (x != 0) {
            ans++;
        }
        ans += (x + k - 1) / k;
        System.out.println(ans);
    }
}
0