結果

問題 No.48 ロボットの操縦
ユーザー ieneko18
提出日時 2016-11-28 15:01:10
言語 Java
(openjdk 23)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 330 bytes
コンパイル時間 1,956 ms
コンパイル使用メモリ 73,864 KB
実行使用メモリ 41,532 KB
最終ジャッジ日時 2024-11-27 12:39:14
合計ジャッジ時間 6,013 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		double x=Math.abs(sc.nextInt());
		double y=sc.nextInt();
		int l=sc.nextInt();
		int n=0;
		if(y<0)n=2;
		else if(x!=0)n=1;
		System.out.println((int)(Math.ceil(x/l)+Math.ceil(Math.abs(y/l))+n));
	}
}
0