結果

問題 No.48 ロボットの操縦
ユーザー numberfrom
提出日時 2020-05-25 13:59:09
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 358 bytes
コンパイル時間 1,796 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 56,084 KB
最終ジャッジ日時 2024-10-13 02:03:31
合計ジャッジ時間 5,683 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

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

		int x, y, l;
		x = sc.nextInt();
		y = sc.nextInt();
		l = sc.nextInt();

		sc.close();

		int ans;
		if(x == 0) ans = 0;
		else ans = 1;

		if (x < 0){
			ans++;
			x *= -1;
		}

		System.out.println(x/l + y/l + ans);

	}

}
0