結果

問題 No.48 ロボットの操縦
ユーザー kou6839kou6839
提出日時 2014-11-19 13:27:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 2,120 ms
コンパイル使用メモリ 72,004 KB
実行使用メモリ 58,632 KB
最終ジャッジ日時 2023-08-30 21:48:27
合計ジャッジ時間 6,741 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
56,128 KB
testcase_01 AC 129 ms
58,632 KB
testcase_02 WA -
testcase_03 AC 130 ms
56,160 KB
testcase_04 AC 131 ms
56,428 KB
testcase_05 AC 132 ms
55,888 KB
testcase_06 AC 133 ms
56,220 KB
testcase_07 AC 133 ms
56,332 KB
testcase_08 AC 133 ms
56,064 KB
testcase_09 AC 132 ms
55,976 KB
testcase_10 AC 130 ms
56,488 KB
testcase_11 AC 129 ms
56,348 KB
testcase_12 AC 129 ms
55,688 KB
testcase_13 AC 134 ms
57,796 KB
testcase_14 AC 129 ms
56,532 KB
testcase_15 AC 129 ms
56,360 KB
testcase_16 AC 129 ms
56,312 KB
testcase_17 AC 131 ms
56,452 KB
testcase_18 AC 128 ms
56,312 KB
testcase_19 AC 128 ms
56,656 KB
testcase_20 AC 132 ms
56,312 KB
testcase_21 AC 127 ms
56,236 KB
testcase_22 AC 130 ms
56,456 KB
testcase_23 AC 129 ms
56,436 KB
testcase_24 AC 132 ms
56,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
 

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