結果

問題 No.48 ロボットの操縦
ユーザー HaleakalaHaleakala
提出日時 2018-02-24 16:53:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 3,451 ms
コンパイル使用メモリ 74,920 KB
実行使用メモリ 54,440 KB
最終ジャッジ日時 2024-04-22 15:38:39
合計ジャッジ時間 7,662 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
41,344 KB
testcase_01 AC 114 ms
41,036 KB
testcase_02 AC 124 ms
41,092 KB
testcase_03 WA -
testcase_04 AC 126 ms
41,116 KB
testcase_05 AC 110 ms
41,264 KB
testcase_06 AC 112 ms
40,204 KB
testcase_07 AC 126 ms
41,640 KB
testcase_08 WA -
testcase_09 AC 124 ms
41,280 KB
testcase_10 WA -
testcase_11 AC 126 ms
41,564 KB
testcase_12 AC 125 ms
41,128 KB
testcase_13 AC 124 ms
41,680 KB
testcase_14 AC 125 ms
41,228 KB
testcase_15 AC 126 ms
41,028 KB
testcase_16 AC 123 ms
41,400 KB
testcase_17 AC 122 ms
41,592 KB
testcase_18 WA -
testcase_19 AC 110 ms
41,460 KB
testcase_20 AC 126 ms
41,336 KB
testcase_21 AC 112 ms
39,964 KB
testcase_22 WA -
testcase_23 AC 126 ms
40,964 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Answer {
	public static void main(String str[]) {
        Scanner sc = new Scanner(System.in);
        double x = Double.valueOf(sc.nextLine());
        double y = Double.valueOf(sc.nextLine());
        double l = Double.valueOf(sc.nextLine());

        int operationNum = 0;
        if(y<0) {
        	operationNum += 2;
        } if(x != 0) {
        	operationNum += 1;
        }

        operationNum += Math.ceil(Math.abs(x/l));
        operationNum += Math.ceil(Math.abs(y/l));
        System.out.println(operationNum);
	}
}
0