結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
53,964 KB
testcase_01 AC 157 ms
54,168 KB
testcase_02 AC 151 ms
53,928 KB
testcase_03 AC 144 ms
54,200 KB
testcase_04 AC 143 ms
54,008 KB
testcase_05 AC 143 ms
54,172 KB
testcase_06 WA -
testcase_07 AC 144 ms
53,872 KB
testcase_08 AC 145 ms
53,780 KB
testcase_09 AC 149 ms
54,084 KB
testcase_10 AC 141 ms
54,188 KB
testcase_11 AC 143 ms
53,976 KB
testcase_12 AC 142 ms
54,248 KB
testcase_13 AC 143 ms
54,176 KB
testcase_14 AC 143 ms
54,008 KB
testcase_15 AC 147 ms
53,616 KB
testcase_16 AC 142 ms
54,080 KB
testcase_17 AC 142 ms
54,424 KB
testcase_18 AC 147 ms
53,768 KB
testcase_19 AC 143 ms
54,112 KB
testcase_20 AC 143 ms
53,888 KB
testcase_21 AC 148 ms
54,076 KB
testcase_22 AC 142 ms
53,604 KB
testcase_23 AC 143 ms
54,420 KB
testcase_24 AC 143 ms
53,960 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 && x==0) {times += 0;}
		else if (y>0 && x!=0) {times += 1;}
		else if (y<0) {times += 2;}
		System.out.println(times);
	}
}
0