結果

問題 No.48 ロボットの操縦
ユーザー uafr_csuafr_cs
提出日時 2015-05-15 02:01:08
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 1,970 ms
コンパイル使用メモリ 72,188 KB
実行使用メモリ 58,152 KB
最終ジャッジ日時 2023-09-20 07:55:35
合計ジャッジ時間 6,522 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 123 ms
53,444 KB
testcase_02 AC 124 ms
56,092 KB
testcase_03 AC 122 ms
55,972 KB
testcase_04 AC 124 ms
58,152 KB
testcase_05 WA -
testcase_06 AC 124 ms
55,716 KB
testcase_07 AC 123 ms
55,756 KB
testcase_08 AC 123 ms
56,036 KB
testcase_09 AC 125 ms
56,004 KB
testcase_10 AC 123 ms
55,908 KB
testcase_11 AC 125 ms
55,512 KB
testcase_12 AC 125 ms
55,728 KB
testcase_13 AC 123 ms
56,204 KB
testcase_14 AC 123 ms
55,652 KB
testcase_15 AC 125 ms
55,976 KB
testcase_16 AC 126 ms
56,020 KB
testcase_17 AC 126 ms
55,932 KB
testcase_18 AC 123 ms
55,772 KB
testcase_19 AC 123 ms
55,772 KB
testcase_20 AC 123 ms
55,856 KB
testcase_21 AC 126 ms
55,716 KB
testcase_22 AC 122 ms
55,696 KB
testcase_23 AC 124 ms
55,876 KB
testcase_24 AC 124 ms
55,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		final long X = sc.nextLong();
		final long Y = sc.nextLong();
		final long L = sc.nextLong();
		
		System.out.println(((Math.abs(X) / L) + (Math.abs(X) % L != 0 ? 1 : 0)) + ((Math.abs(Y) / L) + (Math.abs(Y) % L != 0 ? 1 : 0)) + (Y < 0 ? 2 : 1));
		
	}
	
}
0