結果

問題 No.48 ロボットの操縦
ユーザー scachescache
提出日時 2014-11-30 22:58:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 3,504 ms
コンパイル使用メモリ 72,212 KB
実行使用メモリ 56,448 KB
最終ジャッジ日時 2023-09-02 00:58:06
合計ジャッジ時間 7,874 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,956 KB
testcase_01 AC 127 ms
55,940 KB
testcase_02 WA -
testcase_03 AC 126 ms
55,696 KB
testcase_04 AC 129 ms
55,808 KB
testcase_05 AC 129 ms
55,720 KB
testcase_06 WA -
testcase_07 AC 128 ms
56,108 KB
testcase_08 AC 125 ms
55,964 KB
testcase_09 AC 124 ms
56,228 KB
testcase_10 AC 126 ms
56,012 KB
testcase_11 AC 128 ms
56,176 KB
testcase_12 AC 128 ms
55,876 KB
testcase_13 AC 129 ms
56,448 KB
testcase_14 AC 134 ms
55,536 KB
testcase_15 AC 130 ms
53,840 KB
testcase_16 AC 128 ms
55,748 KB
testcase_17 AC 125 ms
55,916 KB
testcase_18 AC 121 ms
55,840 KB
testcase_19 AC 130 ms
56,112 KB
testcase_20 AC 122 ms
55,868 KB
testcase_21 AC 120 ms
56,212 KB
testcase_22 AC 122 ms
55,988 KB
testcase_23 AC 119 ms
55,732 KB
testcase_24 AC 120 ms
56,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main48 {
	public static void main(String[] args) {
		Main48 p = new Main48();
	}

	public Main48() {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int l = sc.nextInt();
		solve(x, y, l);
	}

	public void solve(int x, int y, int l) {
		int res = (Math.abs(x)-1)/l + 1 + (Math.abs(y)-1)/l + 1;
		if(y<0)
			res+=2;
		else if(Math.abs(x)>0)
			res++;
		
		System.out.println(res);
	}

}
0