結果

問題 No.48 ロボットの操縦
ユーザー uafr_csuafr_cs
提出日時 2015-05-15 02:02:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 456 bytes
コンパイル時間 1,799 ms
コンパイル使用メモリ 74,760 KB
実行使用メモリ 54,112 KB
最終ジャッジ日時 2024-05-01 13:36:42
合計ジャッジ時間 5,434 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
54,104 KB
testcase_01 AC 115 ms
54,016 KB
testcase_02 AC 119 ms
53,904 KB
testcase_03 AC 115 ms
53,948 KB
testcase_04 AC 115 ms
53,988 KB
testcase_05 AC 113 ms
52,952 KB
testcase_06 AC 110 ms
53,432 KB
testcase_07 AC 115 ms
53,868 KB
testcase_08 AC 114 ms
53,904 KB
testcase_09 AC 103 ms
52,748 KB
testcase_10 AC 112 ms
53,980 KB
testcase_11 AC 108 ms
52,700 KB
testcase_12 AC 108 ms
52,812 KB
testcase_13 AC 108 ms
53,036 KB
testcase_14 AC 114 ms
53,796 KB
testcase_15 AC 113 ms
53,740 KB
testcase_16 AC 110 ms
54,112 KB
testcase_17 AC 103 ms
52,884 KB
testcase_18 AC 113 ms
54,100 KB
testcase_19 AC 113 ms
52,820 KB
testcase_20 AC 116 ms
53,892 KB
testcase_21 AC 103 ms
52,836 KB
testcase_22 AC 115 ms
53,736 KB
testcase_23 AC 103 ms
52,752 KB
testcase_24 AC 113 ms
52,944 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