結果

問題 No.48 ロボットの操縦
ユーザー sasakki
提出日時 2016-05-30 20:15:14
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 430 bytes
コンパイル時間 2,031 ms
コンパイル使用メモリ 75,180 KB
実行使用メモリ 54,240 KB
最終ジャッジ日時 2024-10-07 18:51:01
合計ジャッジ時間 5,861 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int X = Integer.parseInt(sc.next());
		int Y = Integer.parseInt(sc.next());
		int L = Integer.parseInt(sc.next());

		int ans = (Math.abs(X)+L-1)/L + (Math.abs(Y)+L-1)/L;

		if(Y>=0){
			if(X!=0){
				ans++;
					}
		}
		else{
			ans = ans + 2;
			if(X!=0){
				ans++;
			}
		}
				
		System.out.println(ans);
	}
}
0