結果

問題 No.48 ロボットの操縦
ユーザー kuramu
提出日時 2016-01-19 23:28:44
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 777 bytes
コンパイル時間 2,711 ms
コンパイル使用メモリ 74,724 KB
実行使用メモリ 50,360 KB
最終ジャッジ日時 2024-09-21 14:39:32
合計ジャッジ時間 4,543 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
	      String line = "";
	      int count=0;
	      try {
	    	  int X = Integer.parseInt(stdReader.readLine());
	    	  int Y = Integer.parseInt(stdReader.readLine());
	    	  int L = Integer.parseInt(stdReader.readLine());
    		  count += Math.abs(X)/L;
	    	  if(X%L!= 0) count++;
	    	  count += Math.abs(Y)/L;
	    	  if(Y%L!=0) count++;
	    	  if(Y<0) count += 2;
	    	  if(X!=0) count++;
	    	  System.out.println(count);
	    	  } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0