結果

問題 No.48 ロボットの操縦
ユーザー kuramukuramu
提出日時 2016-01-19 23:28:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 777 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 74,592 KB
実行使用メモリ 53,512 KB
最終ジャッジ日時 2023-10-21 13:25:19
合計ジャッジ時間 4,462 ms
ジャッジサーバーID
(参考情報)
judge14 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
53,480 KB
testcase_01 AC 56 ms
53,484 KB
testcase_02 AC 55 ms
53,476 KB
testcase_03 WA -
testcase_04 AC 55 ms
53,496 KB
testcase_05 AC 56 ms
53,476 KB
testcase_06 AC 55 ms
53,488 KB
testcase_07 AC 56 ms
53,488 KB
testcase_08 WA -
testcase_09 AC 53 ms
53,476 KB
testcase_10 WA -
testcase_11 AC 56 ms
52,368 KB
testcase_12 AC 56 ms
53,488 KB
testcase_13 AC 54 ms
53,484 KB
testcase_14 AC 56 ms
53,476 KB
testcase_15 AC 55 ms
53,480 KB
testcase_16 AC 54 ms
53,472 KB
testcase_17 AC 54 ms
53,480 KB
testcase_18 WA -
testcase_19 AC 56 ms
53,476 KB
testcase_20 AC 56 ms
53,480 KB
testcase_21 AC 54 ms
53,480 KB
testcase_22 WA -
testcase_23 AC 54 ms
53,476 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

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