結果

問題 No.48 ロボットの操縦
ユーザー 3pstn3pstn
提出日時 2014-12-21 17:31:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 632 bytes
コンパイル時間 2,369 ms
コンパイル使用メモリ 79,200 KB
実行使用メモリ 41,916 KB
最終ジャッジ日時 2024-05-01 13:32:26
合計ジャッジ時間 6,216 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
41,644 KB
testcase_01 AC 130 ms
41,624 KB
testcase_02 AC 127 ms
41,108 KB
testcase_03 AC 131 ms
41,560 KB
testcase_04 AC 128 ms
41,216 KB
testcase_05 AC 127 ms
41,660 KB
testcase_06 AC 128 ms
41,520 KB
testcase_07 AC 127 ms
41,580 KB
testcase_08 AC 129 ms
41,668 KB
testcase_09 AC 132 ms
41,600 KB
testcase_10 AC 132 ms
41,504 KB
testcase_11 AC 129 ms
41,376 KB
testcase_12 AC 129 ms
41,668 KB
testcase_13 AC 130 ms
41,408 KB
testcase_14 AC 126 ms
41,392 KB
testcase_15 AC 131 ms
41,112 KB
testcase_16 AC 115 ms
41,296 KB
testcase_17 AC 130 ms
41,152 KB
testcase_18 AC 128 ms
41,396 KB
testcase_19 AC 128 ms
41,264 KB
testcase_20 AC 127 ms
41,324 KB
testcase_21 AC 128 ms
41,916 KB
testcase_22 AC 123 ms
41,500 KB
testcase_23 AC 127 ms
41,300 KB
testcase_24 AC 130 ms
41,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の入力
	int x = sc.nextInt();
	int y = sc.nextInt();
	double l = sc.nextInt();

	double countx = 0;
	double county = 0;
	int countturn = 0;

	countx = Math.ceil(Math.abs(x) / l);
	county = Math.ceil(Math.abs(y) / l);
	//System.out.println(countx);
	//System.out.println(county);

	if(y < 0) countturn = 2;
	else if(x == 0) countturn = 0;
	else countturn = 1;
	//System.out.println(countturn);

	int total = 0;
	total = (int)countx + (int)county + countturn;
	System.out.println(total);
  }
}
0