結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2016-02-05 17:59:46 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 125 ms / 5,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 2,588 ms |
コンパイル使用メモリ | 74,952 KB |
実行使用メモリ | 41,400 KB |
最終ジャッジ日時 | 2024-11-21 18:34:19 |
合計ジャッジ時間 | 5,792 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
import java.util.Scanner;class Test {public static void main(String[] args) throws Exception {Scanner in = new Scanner(System.in);int x = in.nextInt();int y = in.nextInt();int l = in.nextInt();int ans = 0;if((x != 0) && (y >= 0)) {ans++;} else if(y < 0) {ans += 2;}x = Math.abs(x);y = Math.abs(y);ans += (x + l - 1) / l;ans += (y + l - 1) / l;System.out.println(ans);}}