結果

問題 No.48 ロボットの操縦
ユーザー papipenpapipen
提出日時 2017-03-27 23:02:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 4,537 ms
コンパイル使用メモリ 70,776 KB
実行使用メモリ 56,104 KB
最終ジャッジ日時 2023-09-20 14:45:04
合計ジャッジ時間 7,381 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,492 KB
testcase_01 AC 125 ms
55,360 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 124 ms
55,740 KB
testcase_05 AC 123 ms
55,284 KB
testcase_06 WA -
testcase_07 AC 126 ms
55,268 KB
testcase_08 WA -
testcase_09 AC 125 ms
55,796 KB
testcase_10 WA -
testcase_11 AC 129 ms
55,264 KB
testcase_12 AC 125 ms
55,396 KB
testcase_13 AC 125 ms
55,384 KB
testcase_14 AC 125 ms
55,364 KB
testcase_15 AC 126 ms
56,052 KB
testcase_16 AC 125 ms
55,888 KB
testcase_17 AC 128 ms
55,684 KB
testcase_18 WA -
testcase_19 AC 129 ms
55,660 KB
testcase_20 AC 128 ms
55,660 KB
testcase_21 AC 129 ms
55,324 KB
testcase_22 WA -
testcase_23 AC 126 ms
55,260 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class robotto{
	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		int x = s.nextInt();
		int y = s.nextInt();
		int L = s.nextInt();
		int xtime = (int)Math.abs(x / L);
		int ytime = (int)Math.abs(y / L);
		int retur = 1;
		if(x == 0 || y == 0){
			retur = 0;
		}
		if(x != 0 && (x % L != 0 || Math.abs(x) < L)){
			xtime += 1;
		}
		if(y != 0 && (y % L != 0 || Math.abs(y) < L)){
			ytime += 1;
		}
		System.out.println(xtime + ytime + retur);
	}
}
0