結果

問題 No.126 2基のエレベータ
ユーザー m2543315647m2543315647
提出日時 2015-05-17 16:58:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 321 bytes
コンパイル時間 3,700 ms
コンパイル使用メモリ 71,776 KB
実行使用メモリ 57,920 KB
最終ジャッジ日時 2023-09-20 09:26:21
合計ジャッジ時間 9,189 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 130 ms
55,832 KB
testcase_02 WA -
testcase_03 AC 130 ms
55,640 KB
testcase_04 AC 128 ms
55,936 KB
testcase_05 AC 127 ms
55,748 KB
testcase_06 AC 131 ms
55,620 KB
testcase_07 AC 129 ms
55,580 KB
testcase_08 AC 128 ms
55,588 KB
testcase_09 AC 131 ms
55,984 KB
testcase_10 AC 131 ms
55,736 KB
testcase_11 AC 130 ms
55,612 KB
testcase_12 AC 131 ms
55,432 KB
testcase_13 AC 129 ms
55,792 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 127 ms
55,956 KB
testcase_19 AC 128 ms
57,580 KB
testcase_20 WA -
testcase_21 AC 130 ms
55,756 KB
testcase_22 AC 131 ms
55,840 KB
testcase_23 AC 128 ms
55,404 KB
testcase_24 AC 130 ms
56,120 KB
testcase_25 AC 129 ms
55,856 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 130 ms
55,796 KB
testcase_29 AC 129 ms
55,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No126 {
	public static void main (String[] args)
	{
		Scanner sc=new Scanner(System.in);
		int a,b,s,count;
		a=sc.nextInt();
		b=sc.nextInt();
		s=sc.nextInt();
		count=0;
		if(a==0){count++;a++;};
		count+=Math.min(Math.abs(a-s),Math.abs(b-s))+s;
		System.out.println(count);
	}
}
0