結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー Tsukasa_Type
提出日時 2018-02-09 14:37:50
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 2,818 ms
コンパイル使用メモリ 74,072 KB
実行使用メモリ 55,932 KB
最終ジャッジ日時 2024-10-06 18:21:44
合計ジャッジ時間 7,185 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int x = Math.abs(sc.nextInt());
		int y = Math.abs(sc.nextInt());
		int leng = sc.nextInt();
		int times = (x+leng-1)/leng + (y+leng-1)/leng;
		if (y < 0) {times += 2;}
		else if (y>0 && x!=0) {times += 1;}
		System.out.println(times);
	}
}
0