結果

問題 No.48 ロボットの操縦
ユーザー ぴろずぴろず
提出日時 2014-12-15 15:17:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 2,141 ms
コンパイル使用メモリ 71,828 KB
実行使用メモリ 56,076 KB
最終ジャッジ日時 2023-09-02 14:52:00
合計ジャッジ時間 7,008 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,452 KB
testcase_01 AC 124 ms
55,636 KB
testcase_02 WA -
testcase_03 AC 124 ms
55,776 KB
testcase_04 AC 123 ms
55,492 KB
testcase_05 AC 123 ms
55,560 KB
testcase_06 WA -
testcase_07 AC 124 ms
55,456 KB
testcase_08 AC 126 ms
55,456 KB
testcase_09 AC 126 ms
55,304 KB
testcase_10 AC 126 ms
55,308 KB
testcase_11 AC 125 ms
55,308 KB
testcase_12 AC 127 ms
55,736 KB
testcase_13 AC 128 ms
55,716 KB
testcase_14 AC 126 ms
55,540 KB
testcase_15 AC 126 ms
55,344 KB
testcase_16 AC 126 ms
55,648 KB
testcase_17 AC 125 ms
55,684 KB
testcase_18 AC 124 ms
55,684 KB
testcase_19 AC 131 ms
55,532 KB
testcase_20 AC 126 ms
55,524 KB
testcase_21 AC 125 ms
55,668 KB
testcase_22 AC 127 ms
55,420 KB
testcase_23 AC 127 ms
55,720 KB
testcase_24 AC 127 ms
55,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no048;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextInt();
		long y = sc.nextInt();
		long l = sc.nextInt();
		long ans = 0;
		if (y >= 0) {
			if (x != 0) {
				ans += 1;
			}
		}else{
			ans += 2;
		}
		ans += (Math.abs(x) - 1) / l + 1;
		ans += (Math.abs(y) - 1) / l + 1;
		System.out.println(ans);
	}

}
0