結果

問題 No.48 ロボットの操縦
ユーザー キョウチクキョウチク
提出日時 2022-05-28 18:38:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 569 bytes
コンパイル時間 4,258 ms
コンパイル使用メモリ 80,752 KB
実行使用メモリ 57,592 KB
最終ジャッジ日時 2023-10-20 23:32:00
合計ジャッジ時間 8,846 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
57,408 KB
testcase_01 AC 123 ms
57,160 KB
testcase_02 AC 125 ms
55,136 KB
testcase_03 AC 128 ms
57,420 KB
testcase_04 AC 122 ms
57,236 KB
testcase_05 AC 120 ms
57,228 KB
testcase_06 AC 120 ms
57,452 KB
testcase_07 AC 118 ms
57,432 KB
testcase_08 AC 128 ms
57,588 KB
testcase_09 AC 123 ms
57,524 KB
testcase_10 AC 121 ms
57,392 KB
testcase_11 AC 120 ms
57,452 KB
testcase_12 AC 123 ms
57,568 KB
testcase_13 AC 114 ms
57,436 KB
testcase_14 AC 116 ms
57,592 KB
testcase_15 AC 127 ms
57,584 KB
testcase_16 AC 119 ms
57,452 KB
testcase_17 AC 116 ms
57,420 KB
testcase_18 AC 120 ms
57,452 KB
testcase_19 AC 120 ms
57,456 KB
testcase_20 AC 121 ms
57,460 KB
testcase_21 AC 126 ms
57,448 KB
testcase_22 AC 125 ms
57,320 KB
testcase_23 AC 121 ms
57,496 KB
testcase_24 AC 121 ms
57,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test12 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String[] line;
    line=sc.nextLine().split(" ");
    int x=Integer.parseInt(line[0]);
    line=sc.nextLine().split(" ");
    int y=Integer.parseInt(line[0]);
    line=sc.nextLine().split(" ");
    int l=Integer.parseInt(line[0]);
    int turn=0;
    if(x!=0){
      turn=1;
      if(x<0) x*=-1;
    }
    if(y<0){
      turn=2;
      y*=-1;
    }
    turn+=(x+l-1)/l;
    turn+=(y+l-1)/l;
    System.out.println(turn);
    sc.close();
  }
}
0