結果

問題 No.48 ロボットの操縦
ユーザー uafr_csuafr_cs
提出日時 2015-05-15 02:02:51
言語 Java19
(openjdk 21)
結果
AC  
実行時間 118 ms / 5,000 ms
コード長 456 bytes
コンパイル時間 1,867 ms
コンパイル使用メモリ 71,956 KB
実行使用メモリ 56,512 KB
最終ジャッジ日時 2023-08-14 00:06:59
合計ジャッジ時間 5,655 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
56,024 KB
testcase_01 AC 106 ms
55,724 KB
testcase_02 AC 108 ms
56,512 KB
testcase_03 AC 105 ms
56,332 KB
testcase_04 AC 107 ms
55,948 KB
testcase_05 AC 109 ms
55,456 KB
testcase_06 AC 110 ms
55,880 KB
testcase_07 AC 110 ms
56,108 KB
testcase_08 AC 109 ms
55,668 KB
testcase_09 AC 111 ms
55,864 KB
testcase_10 AC 111 ms
55,984 KB
testcase_11 AC 109 ms
56,128 KB
testcase_12 AC 110 ms
56,312 KB
testcase_13 AC 108 ms
55,664 KB
testcase_14 AC 109 ms
56,284 KB
testcase_15 AC 106 ms
56,424 KB
testcase_16 AC 107 ms
56,144 KB
testcase_17 AC 110 ms
55,456 KB
testcase_18 AC 108 ms
56,200 KB
testcase_19 AC 105 ms
55,768 KB
testcase_20 AC 106 ms
56,244 KB
testcase_21 AC 107 ms
56,016 KB
testcase_22 AC 117 ms
55,892 KB
testcase_23 AC 118 ms
56,468 KB
testcase_24 AC 113 ms
55,860 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 : X != 0 ? 1 : 0));
		
	}
	
}
0