結果

問題 No.149 碁石の移動
ユーザー kenji_shioya
提出日時 2016-06-24 01:08:22
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 3,315 ms
コンパイル使用メモリ 74,832 KB
実行使用メモリ 41,380 KB
最終ジャッジ日時 2024-12-24 03:17:16
合計ジャッジ時間 6,189 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise118{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int[] a = new int[2];
    int[] b = new int[2];
    a[0] = sc.nextInt();
    a[1] = sc.nextInt();
    b[0] = sc.nextInt();
    b[1] = sc.nextInt();
    int f = sc.nextInt();
    int s = sc.nextInt();
    b[0] += Math.min((a[1] > f) ? 0 : f - a[1], a[0]);
    a[0] -= Math.min((a[1] > f) ? 0 : f - a[1], a[0]);
    a[0] += Math.min(s, b[0]);
    System.out.println(a[0]);
  }
}
0