結果

問題 No.48 ロボットの操縦
ユーザー Mcpu3Mcpu3
提出日時 2018-06-22 20:36:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 373 bytes
コンパイル時間 1,842 ms
コンパイル使用メモリ 71,896 KB
実行使用メモリ 57,860 KB
最終ジャッジ日時 2023-09-13 08:06:02
合計ジャッジ時間 6,324 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,288 KB
testcase_01 AC 118 ms
55,652 KB
testcase_02 AC 118 ms
56,036 KB
testcase_03 AC 118 ms
54,092 KB
testcase_04 AC 119 ms
56,088 KB
testcase_05 AC 119 ms
55,852 KB
testcase_06 AC 119 ms
55,796 KB
testcase_07 AC 118 ms
55,768 KB
testcase_08 AC 118 ms
56,100 KB
testcase_09 AC 119 ms
57,860 KB
testcase_10 AC 118 ms
56,028 KB
testcase_11 AC 118 ms
56,264 KB
testcase_12 AC 121 ms
55,856 KB
testcase_13 AC 119 ms
55,828 KB
testcase_14 AC 118 ms
55,428 KB
testcase_15 AC 116 ms
56,000 KB
testcase_16 AC 120 ms
55,652 KB
testcase_17 AC 122 ms
56,164 KB
testcase_18 AC 119 ms
55,572 KB
testcase_19 AC 120 ms
55,920 KB
testcase_20 AC 119 ms
56,364 KB
testcase_21 AC 119 ms
55,828 KB
testcase_22 AC 118 ms
56,272 KB
testcase_23 AC 122 ms
55,716 KB
testcase_24 AC 118 ms
55,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no48{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int x,y,l,s=0;
		x=stdIn.nextInt();
		y=stdIn.nextInt();
		l=stdIn.nextInt();
		if(y<0) s+=2;
		if(x!=0&&y>=0) s++;
		if(x<0) x=-x;
		if(y<0) y=-y;
		s+=x/l;
		s+=y/l;
		if(x%l!=0) s++;
		if(y%l!=0) s++;
		System.out.print(s);
	}
}
0