結果

問題 No.48 ロボットの操縦
ユーザー HaleakalaHaleakala
提出日時 2018-02-24 16:25:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 631 bytes
コンパイル時間 3,805 ms
コンパイル使用メモリ 80,244 KB
実行使用メモリ 41,496 KB
最終ジャッジ日時 2024-04-22 14:38:49
合計ジャッジ時間 8,103 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,164 KB
testcase_01 AC 127 ms
41,108 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 127 ms
41,496 KB
testcase_05 WA -
testcase_06 AC 116 ms
39,944 KB
testcase_07 WA -
testcase_08 AC 111 ms
40,000 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 123 ms
41,312 KB
testcase_13 WA -
testcase_14 AC 125 ms
41,308 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 114 ms
40,164 KB
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

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

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