結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2017-06-20 17:07:00 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 133 ms / 5,000 ms |
コード長 | 385 bytes |
コンパイル時間 | 2,102 ms |
コンパイル使用メモリ | 73,756 KB |
実行使用メモリ | 41,432 KB |
最終ジャッジ日時 | 2024-10-02 07:22:02 |
合計ジャッジ時間 | 6,304 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
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();int l = sc.nextInt();int ans = (Math.abs(x) + l - 1) / l + (Math.abs(y) + l - 1) / l;if(y < 0) {ans += 2;} else if(x != 0) {ans += 1;}System.out.println(ans);}}