結果
問題 | No.149 碁石の移動 |
ユーザー | ki_ki33 |
提出日時 | 2015-02-12 23:30:25 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 125 ms / 2,000 ms |
コード長 | 1,361 bytes |
コンパイル時間 | 2,124 ms |
コンパイル使用メモリ | 75,728 KB |
実行使用メモリ | 56,672 KB |
最終ジャッジ日時 | 2023-08-25 17:19:22 |
合計ジャッジ時間 | 5,226 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 123 ms
56,340 KB |
testcase_01 | AC | 125 ms
55,720 KB |
testcase_02 | AC | 125 ms
55,896 KB |
testcase_03 | AC | 124 ms
55,960 KB |
testcase_04 | AC | 122 ms
56,420 KB |
testcase_05 | AC | 122 ms
55,948 KB |
testcase_06 | AC | 122 ms
56,272 KB |
testcase_07 | AC | 122 ms
56,148 KB |
testcase_08 | AC | 124 ms
56,328 KB |
testcase_09 | AC | 121 ms
55,976 KB |
testcase_10 | AC | 123 ms
56,064 KB |
testcase_11 | AC | 125 ms
56,672 KB |
testcase_12 | AC | 122 ms
55,800 KB |
testcase_13 | AC | 123 ms
55,804 KB |
testcase_14 | AC | 121 ms
55,784 KB |
testcase_15 | AC | 124 ms
56,080 KB |
testcase_16 | AC | 121 ms
56,200 KB |
ソースコード
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); } }