結果

問題 No.48 ロボットの操縦
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 14:39:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 2,152 ms
コンパイル使用メモリ 74,320 KB
実行使用メモリ 54,428 KB
最終ジャッジ日時 2024-04-16 05:48:21
合計ジャッジ時間 6,751 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
54,236 KB
testcase_01 AC 141 ms
54,320 KB
testcase_02 AC 142 ms
54,188 KB
testcase_03 AC 140 ms
54,244 KB
testcase_04 AC 143 ms
53,908 KB
testcase_05 AC 145 ms
53,928 KB
testcase_06 WA -
testcase_07 AC 146 ms
53,832 KB
testcase_08 AC 143 ms
54,124 KB
testcase_09 AC 150 ms
54,428 KB
testcase_10 AC 141 ms
54,160 KB
testcase_11 AC 144 ms
54,244 KB
testcase_12 AC 141 ms
53,596 KB
testcase_13 AC 141 ms
53,928 KB
testcase_14 AC 144 ms
54,076 KB
testcase_15 AC 142 ms
54,000 KB
testcase_16 AC 144 ms
53,844 KB
testcase_17 AC 141 ms
53,900 KB
testcase_18 AC 143 ms
53,920 KB
testcase_19 AC 141 ms
53,772 KB
testcase_20 AC 142 ms
54,068 KB
testcase_21 AC 143 ms
54,192 KB
testcase_22 AC 145 ms
53,956 KB
testcase_23 AC 143 ms
53,772 KB
testcase_24 AC 146 ms
54,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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