結果

問題 No.48 ロボットの操縦
ユーザー CavasiroCavasiro
提出日時 2020-04-16 22:54:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 383 bytes
コンパイル時間 2,081 ms
コンパイル使用メモリ 74,172 KB
実行使用メモリ 54,376 KB
最終ジャッジ日時 2024-04-10 12:43:05
合計ジャッジ時間 5,793 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
54,016 KB
testcase_01 AC 108 ms
52,896 KB
testcase_02 AC 127 ms
53,844 KB
testcase_03 AC 106 ms
52,852 KB
testcase_04 AC 105 ms
52,796 KB
testcase_05 AC 122 ms
54,132 KB
testcase_06 AC 113 ms
53,116 KB
testcase_07 AC 120 ms
53,900 KB
testcase_08 AC 120 ms
54,084 KB
testcase_09 AC 119 ms
53,876 KB
testcase_10 AC 119 ms
54,108 KB
testcase_11 AC 117 ms
53,988 KB
testcase_12 AC 119 ms
54,144 KB
testcase_13 AC 119 ms
53,996 KB
testcase_14 AC 120 ms
54,172 KB
testcase_15 AC 113 ms
53,852 KB
testcase_16 AC 117 ms
54,212 KB
testcase_17 AC 120 ms
53,848 KB
testcase_18 AC 138 ms
53,072 KB
testcase_19 AC 125 ms
54,196 KB
testcase_20 AC 123 ms
54,240 KB
testcase_21 AC 109 ms
53,000 KB
testcase_22 AC 123 ms
54,376 KB
testcase_23 AC 117 ms
53,996 KB
testcase_24 AC 119 ms
54,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
 
class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int l = sc.nextInt();
		int cnt = 0;
		if(y<0){
			cnt = 2;
		} else if(x != 0) {
			cnt = 1;
		}
		cnt += (Math.ceil(Math.abs(x)*1.0/l));
		cnt += (Math.ceil(Math.abs(y)*1.0/l));
		System.out.println(cnt);
	}
}
0