結果

問題 No.149 碁石の移動
ユーザー uafr_cs
提出日時 2015-05-15 13:41:50
言語 Java
(openjdk 23)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 2,744 ms
コンパイル使用メモリ 73,796 KB
実行使用メモリ 41,224 KB
最終ジャッジ日時 2024-12-24 03:04:05
合計ジャッジ時間 5,971 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		final int Aw = sc.nextInt();
		final int Ab = sc.nextInt();
		final int Bw = sc.nextInt();
		final int Bb = sc.nextInt();
		
		final int C = sc.nextInt();
		final int D = sc.nextInt();
		
		System.out.println(Aw + Math.min(D - Math.max(0, C - Ab), Bw));
		
	}
	
}
0