結果

問題 No.48 ロボットの操縦
ユーザー Cavasiro
提出日時 2020-04-16 22:54:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 383 bytes
コンパイル時間 2,144 ms
コンパイル使用メモリ 74,324 KB
実行使用メモリ 55,912 KB
最終ジャッジ日時 2024-10-02 14:43:22
合計ジャッジ時間 6,183 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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