結果

問題 No.48 ロボットの操縦
ユーザー mustonmuston
提出日時 2016-05-19 14:06:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 106 ms / 5,000 ms
コード長 508 bytes
コンパイル時間 1,582 ms
コンパイル使用メモリ 71,088 KB
実行使用メモリ 56,344 KB
最終ジャッジ日時 2023-08-14 00:36:58
合計ジャッジ時間 5,120 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
55,968 KB
testcase_01 AC 102 ms
55,844 KB
testcase_02 AC 101 ms
55,528 KB
testcase_03 AC 96 ms
55,928 KB
testcase_04 AC 104 ms
56,288 KB
testcase_05 AC 103 ms
55,968 KB
testcase_06 AC 101 ms
56,104 KB
testcase_07 AC 101 ms
56,012 KB
testcase_08 AC 102 ms
56,092 KB
testcase_09 AC 101 ms
56,060 KB
testcase_10 AC 100 ms
55,596 KB
testcase_11 AC 102 ms
56,104 KB
testcase_12 AC 101 ms
56,044 KB
testcase_13 AC 98 ms
55,780 KB
testcase_14 AC 102 ms
56,316 KB
testcase_15 AC 106 ms
55,944 KB
testcase_16 AC 101 ms
55,944 KB
testcase_17 AC 103 ms
56,344 KB
testcase_18 AC 100 ms
56,140 KB
testcase_19 AC 102 ms
56,164 KB
testcase_20 AC 104 ms
53,752 KB
testcase_21 AC 100 ms
55,616 KB
testcase_22 AC 100 ms
55,908 KB
testcase_23 AC 103 ms
56,176 KB
testcase_24 AC 101 ms
55,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
/*yukicoder No.48 ロボットの操縦*/
class No48{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    double x = scan.nextInt();
    double y = scan.nextInt();
    double l = scan.nextInt();
    double count = 0;
    if(y<0){
      y = -y;
      count += 2;
    }else if(x==0){
    }else{
      count++;
    }
    count += Math.ceil(y/l);
    if(x<0) x = -x;
    count += Math.ceil(x/l);
    System.out.println((int)count);
  }
}
0