結果

問題 No.48 ロボットの操縦
ユーザー m2543315647
提出日時 2015-05-14 14:58:26
言語 Java
(openjdk 23)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 3,055 ms
コンパイル使用メモリ 73,912 KB
実行使用メモリ 41,652 KB
最終ジャッジ日時 2024-11-21 18:18:32
合計ジャッジ時間 6,902 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No48 {
	public static void main (String[] args){
	Scanner sc =new Scanner(System.in);
	int x=sc.nextInt();
	int y=sc.nextInt();
	int l=sc.nextInt();
	System.out.println((x!=0?Math.abs(x/l)+1:0)+(y==0?0:y>0?y/l:Math.abs(y/l)+2)+(x%l==0?0:1)+(y%l==0?0:1)-(x!=0&&y<0?1:0));
	}
}
0