結果

問題 No.149 碁石の移動
ユーザー ki_ki33
提出日時 2015-02-12 23:30:25
言語 Java
(openjdk 23)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 1,361 bytes
コンパイル時間 2,104 ms
コンパイル使用メモリ 78,800 KB
実行使用メモリ 41,512 KB
最終ジャッジ日時 2024-12-24 02:44:56
合計ジャッジ時間 4,964 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentSkipListSet;

public class Main {
	public static final int C =  1000000007;
	static final int CY = 1000000000;
	//static boolean MAP[][];
	static int K;
	static int N;
	static double P;
	static String S;
	static int M;
	static int MAX = -1;
	//static int tic[][];
	static int T[][];
	static int Y[];
	static double W[];
	//static int max;
	static long DP[];
	static int ST[][];
	//static int p[];
	//static ArrayList<HashSet<Integer>> al;
	static ConcurrentSkipListSet<Integer> TS;
	static ArrayList<Integer> AL;
	//static int a[][];
	//static char[][] ch;
	//static ArrayList<HashMap<Long, Long>> al;
	//static String a[];
	//static String str;

	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder();
		BufferedInputStream bs = new BufferedInputStream(System.in);
		Scanner sc = new Scanner(bs);



		int aw = sc.nextInt();
		int ab =  sc.nextInt();
		int bw = sc.nextInt();
		int bb = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		
		

		long ans = 0;
		
		ans += aw;
		
		int ch = Math.max(0, c - ab);
		
		ans -= ch;
		
		bw += ch;
		
		ans += Math.min(d,bw);

		
		
		System.out.println(ans);

	}


}
0