結果

問題 No.149 碁石の移動
ユーザー spaciaspacia
提出日時 2016-01-03 15:25:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 735 bytes
コンパイル時間 2,312 ms
コンパイル使用メモリ 71,860 KB
実行使用メモリ 49,632 KB
最終ジャッジ日時 2023-08-25 17:42:12
合計ジャッジ時間 3,777 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
47,844 KB
testcase_01 AC 43 ms
49,216 KB
testcase_02 AC 42 ms
49,376 KB
testcase_03 AC 43 ms
49,124 KB
testcase_04 AC 43 ms
49,400 KB
testcase_05 AC 43 ms
49,632 KB
testcase_06 AC 43 ms
49,316 KB
testcase_07 AC 43 ms
49,292 KB
testcase_08 AC 43 ms
49,316 KB
testcase_09 AC 43 ms
49,220 KB
testcase_10 AC 42 ms
49,516 KB
testcase_11 AC 43 ms
49,232 KB
testcase_12 AC 43 ms
49,348 KB
testcase_13 AC 44 ms
49,216 KB
testcase_14 AC 43 ms
49,344 KB
testcase_15 AC 43 ms
49,384 KB
testcase_16 AC 44 ms
49,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
		
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		String[] line1 = br.readLine().split(" ");
		String[] line2 = br.readLine().split(" ");
		String[] line3 = br.readLine().split(" ");
		
		int aw = Integer.parseInt(line1[0]);
		int ab = Integer.parseInt(line1[1]);
		int bw = Integer.parseInt(line2[0]);
		int bb = Integer.parseInt(line2[1]);
		int c  = Integer.parseInt(line3[0]);
		int d  = Integer.parseInt(line3[1]);
		
		if (c > ab) {
			c -= ab;
			aw -= c;
			bw += c;
		}
		
		out(aw + Math.min(d , bw));
	}
}
0