結果

問題 No.48 ロボットの操縦
ユーザー m2543315647m2543315647
提出日時 2015-05-14 14:58:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 110 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 3,063 ms
コンパイル使用メモリ 72,012 KB
実行使用メモリ 56,280 KB
最終ジャッジ日時 2023-08-14 00:06:15
合計ジャッジ時間 6,378 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
55,860 KB
testcase_01 AC 108 ms
56,140 KB
testcase_02 AC 107 ms
55,856 KB
testcase_03 AC 105 ms
56,280 KB
testcase_04 AC 108 ms
55,800 KB
testcase_05 AC 107 ms
55,828 KB
testcase_06 AC 104 ms
56,160 KB
testcase_07 AC 105 ms
55,720 KB
testcase_08 AC 107 ms
55,912 KB
testcase_09 AC 108 ms
56,096 KB
testcase_10 AC 110 ms
55,908 KB
testcase_11 AC 110 ms
55,904 KB
testcase_12 AC 107 ms
56,052 KB
testcase_13 AC 107 ms
55,756 KB
testcase_14 AC 106 ms
55,936 KB
testcase_15 AC 106 ms
55,728 KB
testcase_16 AC 108 ms
56,240 KB
testcase_17 AC 108 ms
56,240 KB
testcase_18 AC 106 ms
55,992 KB
testcase_19 AC 108 ms
55,976 KB
testcase_20 AC 106 ms
56,168 KB
testcase_21 AC 110 ms
55,884 KB
testcase_22 AC 109 ms
55,732 KB
testcase_23 AC 107 ms
55,772 KB
testcase_24 AC 109 ms
56,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No48 {
	public static void main (String[] args){
	Scanner sc =new Scanner(System.in);
	int x=sc.nextInt();
	int y=sc.nextInt();
	int l=sc.nextInt();
	System.out.println((x!=0?Math.abs(x/l)+1:0)+(y==0?0:y>0?y/l:Math.abs(y/l)+2)+(x%l==0?0:1)+(y%l==0?0:1)-(x!=0&&y<0?1:0));
	}
}
0