結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2018-06-05 16:58:03 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 135 ms / 5,000 ms |
コード長 | 484 bytes |
コンパイル時間 | 2,070 ms |
コンパイル使用メモリ | 74,548 KB |
実行使用メモリ | 54,348 KB |
最終ジャッジ日時 | 2024-06-30 09:55:35 |
合計ジャッジ時間 | 6,324 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
import java.util.Scanner;class Main {public static void main(String[] args) {Scanner scan = new Scanner(System.in);int x = scan.nextInt();int y = scan.nextInt();int l = scan.nextInt();int c = (int)(Math.ceil(Math.abs(x) / (double)l) + Math.ceil(Math.abs(y) / (double)l));if (y < 0) {c += 2;} else if (x != 0) {c += 1;}System.out.println(c);scan.close();}}