結果

問題 No.48 ロボットの操縦
ユーザー uafr_cs
提出日時 2015-05-15 02:02:51
言語 Java
(openjdk 23)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 456 bytes
コンパイル時間 2,092 ms
コンパイル使用メモリ 74,104 KB
実行使用メモリ 41,648 KB
最終ジャッジ日時 2024-11-21 18:19:09
合計ジャッジ時間 5,666 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

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