結果

問題 No.48 ロボットの操縦
ユーザー リチウムリチウム
提出日時 2014-10-23 22:45:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 112 ms / 5,000 ms
コード長 398 bytes
コンパイル時間 3,990 ms
コンパイル使用メモリ 70,976 KB
実行使用メモリ 56,332 KB
最終ジャッジ日時 2023-08-13 23:53:23
合計ジャッジ時間 5,597 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
56,184 KB
testcase_01 AC 102 ms
56,020 KB
testcase_02 AC 103 ms
55,792 KB
testcase_03 AC 107 ms
56,332 KB
testcase_04 AC 105 ms
56,064 KB
testcase_05 AC 103 ms
56,072 KB
testcase_06 AC 103 ms
55,416 KB
testcase_07 AC 106 ms
56,040 KB
testcase_08 AC 107 ms
56,032 KB
testcase_09 AC 106 ms
55,728 KB
testcase_10 AC 105 ms
56,000 KB
testcase_11 AC 112 ms
55,916 KB
testcase_12 AC 106 ms
55,728 KB
testcase_13 AC 108 ms
55,768 KB
testcase_14 AC 104 ms
55,964 KB
testcase_15 AC 104 ms
55,992 KB
testcase_16 AC 103 ms
55,928 KB
testcase_17 AC 103 ms
55,976 KB
testcase_18 AC 102 ms
55,720 KB
testcase_19 AC 104 ms
55,412 KB
testcase_20 AC 109 ms
55,724 KB
testcase_21 AC 103 ms
56,072 KB
testcase_22 AC 106 ms
56,132 KB
testcase_23 AC 104 ms
55,772 KB
testcase_24 AC 103 ms
55,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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