結果

問題 No.48 ロボットの操縦
ユーザー YamaKasa
提出日時 2018-04-21 16:45:07
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 2,187 ms
コンパイル使用メモリ 74,012 KB
実行使用メモリ 41,608 KB
最終ジャッジ日時 2024-06-27 05:24:40
合計ジャッジ時間 6,158 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long X = scan.nextLong();
		long Y = scan.nextLong();
		long L = scan.nextLong();
		scan.close();
		long ans = 0;
		if(Y < 0) {
			ans = 1;
			Y = - Y;
		}
		if(X != 0) {
			ans += 1;
			if(X < 0) {
				X = - X;
			}
		}
		ans += X / L + Y / L;
		if(X % L > 0) {
			ans += 1;
		}
		if(Y % L > 0) {
			ans += 1;
		}
		System.out.println(ans);
	}
}
0