結果

問題 No.149 碁石の移動
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-24 14:57:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 1,900 ms
コンパイル使用メモリ 71,888 KB
実行使用メモリ 56,384 KB
最終ジャッジ日時 2023-08-25 17:27:41
合計ジャッジ時間 4,912 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,312 KB
testcase_01 AC 120 ms
56,384 KB
testcase_02 AC 119 ms
53,776 KB
testcase_03 AC 121 ms
55,800 KB
testcase_04 AC 119 ms
55,752 KB
testcase_05 AC 122 ms
55,912 KB
testcase_06 AC 121 ms
55,796 KB
testcase_07 AC 120 ms
56,028 KB
testcase_08 AC 120 ms
55,928 KB
testcase_09 AC 120 ms
55,884 KB
testcase_10 AC 119 ms
54,216 KB
testcase_11 AC 120 ms
55,808 KB
testcase_12 AC 120 ms
55,904 KB
testcase_13 AC 118 ms
55,544 KB
testcase_14 AC 121 ms
55,780 KB
testcase_15 AC 120 ms
55,772 KB
testcase_16 AC 119 ms
56,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] a) {
		Scanner s = new Scanner(System.in);
		int[] p=new int[6];
		int i=0,b;for(;6>i;)p[i++]=s.nextInt();
		b=(p[4]-p[1]>0)?p[4]-p[1]:0;
		System.out.println(p[0]-b+((p[5]-p[2]-b>0)?p[2]+b:p[5]));
	}
}
0