結果

問題 No.48 ロボットの操縦
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-26 11:59:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 378 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 58,456 KB
最終ジャッジ日時 2023-09-06 05:02:29
合計ジャッジ時間 6,618 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 122 ms
55,760 KB
testcase_02 AC 122 ms
55,800 KB
testcase_03 AC 122 ms
55,592 KB
testcase_04 AC 123 ms
55,332 KB
testcase_05 AC 121 ms
55,828 KB
testcase_06 AC 122 ms
55,788 KB
testcase_07 AC 123 ms
55,560 KB
testcase_08 AC 128 ms
55,596 KB
testcase_09 AC 126 ms
55,516 KB
testcase_10 AC 121 ms
55,424 KB
testcase_11 AC 121 ms
55,792 KB
testcase_12 AC 120 ms
55,460 KB
testcase_13 AC 121 ms
55,708 KB
testcase_14 AC 121 ms
55,852 KB
testcase_15 AC 126 ms
55,724 KB
testcase_16 AC 123 ms
55,512 KB
testcase_17 AC 124 ms
55,512 KB
testcase_18 AC 123 ms
55,560 KB
testcase_19 AC 124 ms
55,704 KB
testcase_20 AC 129 ms
55,776 KB
testcase_21 AC 124 ms
55,520 KB
testcase_22 AC 127 ms
55,780 KB
testcase_23 AC 124 ms
55,628 KB
testcase_24 AC 122 ms
55,560 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,1,1})[P]);
	}
}
0