結果

問題 No.48 ロボットの操縦
ユーザー No
提出日時 2017-08-01 21:21:03
言語 Java
(openjdk 23)
結果
AC  
実行時間 154 ms / 5,000 ms
コード長 410 bytes
コンパイル時間 2,180 ms
コンパイル使用メモリ 73,152 KB
実行使用メモリ 41,660 KB
最終ジャッジ日時 2024-10-11 00:17:53
合計ジャッジ時間 6,918 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);

    	int x = sc.nextInt();
    	int y = sc.nextInt();
    	double l = sc.nextDouble();
    	int ans = (int)(Math.ceil(Math.abs(x) / l) + Math.ceil(Math.abs(y) / l));
    	int n = 0;
    	if(y < 0)n = 2;
    	if(y >= 0 && x != 0)n = 1;
    	System.out.println(ans + n);
    }
}
0