結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2019-03-15 17:46:10 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 849 bytes |
コンパイル時間 | 2,507 ms |
コンパイル使用メモリ | 75,052 KB |
実行使用メモリ | 41,308 KB |
最終ジャッジ日時 | 2024-07-01 20:02:15 |
合計ジャッジ時間 | 6,177 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 7 |
ソースコード
import java.util.*; class Main { private static final String SPLIT_STR = " "; public static void main(String[] args) { // Scanner生成 Scanner sc = new Scanner(System.in); // 入力設定 String input = sc.nextLine(); int X = Integer.parseInt(input); sc.reset(); input = sc.nextLine(); int Y = Integer.parseInt(input); sc.reset(); input = sc.nextLine(); int L = Integer.parseInt(input); // Scannerクローズ sc.close(); /* メイン処理開始 */ // 変数初期化 int result = 0; int turnCnt = 0; // 結果設定 if (X != 0 && Y >= 0) { turnCnt++; } if (X < 0) { X *= -1; } if (Y < 0) { Y *= -1; turnCnt++; } result = (int)Math.ceil((double)X / L) + (int)Math.ceil((double)Y / L) + turnCnt; /* メイン処理終了 */ // 結果出力 System.out.println(result); } }