結果

問題 No.48 ロボットの操縦
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 14:37:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 4,491 ms
コンパイル使用メモリ 79,424 KB
実行使用メモリ 54,392 KB
最終ジャッジ日時 2024-04-16 05:41:38
合計ジャッジ時間 6,952 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,104 KB
testcase_01 AC 133 ms
41,396 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 131 ms
41,468 KB
testcase_05 AC 132 ms
41,420 KB
testcase_06 WA -
testcase_07 AC 133 ms
41,160 KB
testcase_08 WA -
testcase_09 AC 133 ms
41,580 KB
testcase_10 WA -
testcase_11 AC 133 ms
41,472 KB
testcase_12 AC 132 ms
41,284 KB
testcase_13 AC 130 ms
41,272 KB
testcase_14 AC 132 ms
41,364 KB
testcase_15 AC 134 ms
41,424 KB
testcase_16 AC 134 ms
41,300 KB
testcase_17 AC 132 ms
41,304 KB
testcase_18 WA -
testcase_19 AC 132 ms
41,476 KB
testcase_20 AC 133 ms
41,284 KB
testcase_21 AC 135 ms
41,288 KB
testcase_22 WA -
testcase_23 AC 135 ms
41,388 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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