結果

問題 No.48 ロボットの操縦
ユーザー kano_townkano_town
提出日時 2014-11-19 17:58:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 423 bytes
コンパイル時間 3,758 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 54,140 KB
最終ジャッジ日時 2024-05-01 13:28:05
合計ジャッジ時間 7,349 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
52,720 KB
testcase_01 AC 112 ms
54,064 KB
testcase_02 AC 105 ms
53,108 KB
testcase_03 AC 115 ms
54,104 KB
testcase_04 AC 102 ms
52,848 KB
testcase_05 AC 103 ms
52,828 KB
testcase_06 AC 112 ms
53,836 KB
testcase_07 AC 115 ms
53,992 KB
testcase_08 AC 118 ms
53,864 KB
testcase_09 AC 105 ms
52,964 KB
testcase_10 AC 102 ms
54,008 KB
testcase_11 AC 105 ms
54,092 KB
testcase_12 AC 115 ms
54,140 KB
testcase_13 AC 105 ms
52,896 KB
testcase_14 AC 126 ms
54,084 KB
testcase_15 AC 119 ms
53,932 KB
testcase_16 AC 108 ms
52,940 KB
testcase_17 AC 120 ms
53,908 KB
testcase_18 AC 111 ms
54,056 KB
testcase_19 AC 112 ms
53,896 KB
testcase_20 AC 119 ms
53,840 KB
testcase_21 AC 106 ms
53,064 KB
testcase_22 AC 110 ms
54,020 KB
testcase_23 AC 113 ms
54,116 KB
testcase_24 AC 103 ms
52,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder48 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int Y = sc.nextInt();
		double L = sc.nextInt();
		int count = 0;
		
		if (Y < 0) count = 2;
		else if (X != 0) count = 1;
		
		count += Math.ceil(Math.abs(X) / L);
		count += Math.ceil(Math.abs(Y) / L);
		
		System.out.println(count);
	}
}
0