結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,976 KB
testcase_01 AC 128 ms
56,284 KB
testcase_02 WA -
testcase_03 AC 134 ms
56,204 KB
testcase_04 AC 128 ms
55,800 KB
testcase_05 AC 132 ms
55,916 KB
testcase_06 AC 130 ms
56,296 KB
testcase_07 AC 127 ms
55,936 KB
testcase_08 AC 131 ms
56,732 KB
testcase_09 AC 131 ms
56,140 KB
testcase_10 AC 134 ms
56,348 KB
testcase_11 AC 133 ms
55,740 KB
testcase_12 AC 134 ms
56,008 KB
testcase_13 AC 130 ms
56,520 KB
testcase_14 AC 133 ms
58,004 KB
testcase_15 AC 136 ms
56,332 KB
testcase_16 AC 131 ms
55,944 KB
testcase_17 AC 134 ms
55,824 KB
testcase_18 AC 133 ms
56,120 KB
testcase_19 AC 132 ms
56,228 KB
testcase_20 AC 128 ms
56,192 KB
testcase_21 AC 139 ms
56,088 KB
testcase_22 AC 132 ms
56,028 KB
testcase_23 AC 136 ms
56,092 KB
testcase_24 AC 136 ms
56,136 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(x==0&&y==0){
			System.out.println(0);
			return;
		}
		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