結果

問題 No.48 ロボットの操縦
ユーザー Flere0114Flere0114
提出日時 2016-02-10 17:41:46
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 472 bytes
コンパイル時間 3,181 ms
コンパイル使用メモリ 74,508 KB
実行使用メモリ 57,720 KB
最終ジャッジ日時 2023-10-21 20:40:37
合計ジャッジ時間 7,363 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
57,424 KB
testcase_01 AC 130 ms
57,472 KB
testcase_02 WA -
testcase_03 AC 128 ms
57,416 KB
testcase_04 AC 128 ms
57,588 KB
testcase_05 AC 128 ms
57,564 KB
testcase_06 AC 127 ms
57,352 KB
testcase_07 AC 127 ms
57,708 KB
testcase_08 AC 115 ms
56,268 KB
testcase_09 AC 128 ms
57,356 KB
testcase_10 AC 128 ms
56,992 KB
testcase_11 AC 128 ms
55,592 KB
testcase_12 AC 117 ms
56,296 KB
testcase_13 AC 128 ms
57,236 KB
testcase_14 AC 125 ms
57,408 KB
testcase_15 AC 127 ms
57,228 KB
testcase_16 AC 129 ms
57,440 KB
testcase_17 AC 130 ms
57,404 KB
testcase_18 AC 129 ms
57,288 KB
testcase_19 AC 126 ms
57,368 KB
testcase_20 AC 129 ms
57,552 KB
testcase_21 AC 129 ms
57,720 KB
testcase_22 AC 129 ms
57,428 KB
testcase_23 AC 130 ms
57,560 KB
testcase_24 AC 128 ms
57,384 KB
権限があれば一括ダウンロードができます

ソースコード

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 ans = 0;

        ans += (Math.abs(Y) + L - 1) / L;
        ans += (Math.abs(X) + L - 1) / L;
        if(Y < 0){
            ans++;
        }
        if(X != 0){
            ans++;
        }

        System.out.println(ans);
    }
}
0