結果

問題 No.48 ロボットの操縦
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-26 12:01:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 109 ms / 5,000 ms
コード長 378 bytes
コンパイル時間 1,853 ms
コンパイル使用メモリ 70,916 KB
実行使用メモリ 56,312 KB
最終ジャッジ日時 2023-08-14 00:03:37
合計ジャッジ時間 5,385 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
55,704 KB
testcase_01 AC 107 ms
55,816 KB
testcase_02 AC 109 ms
55,688 KB
testcase_03 AC 106 ms
55,844 KB
testcase_04 AC 109 ms
56,016 KB
testcase_05 AC 104 ms
55,700 KB
testcase_06 AC 105 ms
56,156 KB
testcase_07 AC 106 ms
55,744 KB
testcase_08 AC 104 ms
55,976 KB
testcase_09 AC 105 ms
55,920 KB
testcase_10 AC 105 ms
56,144 KB
testcase_11 AC 103 ms
55,768 KB
testcase_12 AC 107 ms
56,276 KB
testcase_13 AC 107 ms
56,088 KB
testcase_14 AC 108 ms
55,848 KB
testcase_15 AC 107 ms
55,944 KB
testcase_16 AC 107 ms
56,312 KB
testcase_17 AC 109 ms
56,312 KB
testcase_18 AC 104 ms
55,876 KB
testcase_19 AC 104 ms
56,040 KB
testcase_20 AC 107 ms
56,020 KB
testcase_21 AC 107 ms
55,896 KB
testcase_22 AC 106 ms
56,048 KB
testcase_23 AC 102 ms
55,852 KB
testcase_24 AC 107 ms
55,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main {
	public static void main(String[] a) {
		Scanner s=new Scanner(System.in);
		int X=s.nextInt(),Y=s.nextInt(),L=s.nextInt();
		int H=(int)Math.ceil(Math.abs((double)X/L)),V=(int)Math.ceil(Math.abs((double)Y/L));
		int P=(int)(Math.signum(X)+1+3*(Math.signum(Y)+1));
		System.out.println(H+V+(new int[]{2,2,2,1,0,1,1,0,1})[P]);
	}
}
0