結果

問題 No.9 モンスターのレベル上げ
ユーザー spaciaspacia
提出日時 2016-01-20 17:07:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,130 bytes
コンパイル時間 2,468 ms
コンパイル使用メモリ 78,120 KB
実行使用メモリ 62,872 KB
最終ジャッジ日時 2023-10-21 13:34:58
合計ジャッジ時間 14,384 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
53,712 KB
testcase_01 AC 56 ms
52,600 KB
testcase_02 WA -
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static int solve (int[] levelM , int[] levelE) {
		int ret = Integer.MAX_VALUE;
		int len = levelM.length;
		Arrays.sort(levelM);
		for (int i = 0; i < len; i++) {
			int win = 0;
			for (int j = i; win++ < len; j++) {
				j %= len;
				levelM[0]++;
				levelM[0] += (levelE[j] >> 1) << 12;
				Arrays.sort(levelM);
			}
			int max = 0;
			for (int k = 0; k < len; k++)
				max = Math.max(max , levelM[k] & 0xfff);
			ret = Math.min(ret , max);
		}
		return ret;
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int len = Integer.parseInt(br.readLine());
		String[] line1 = br.readLine().split(" ");
		int[] levelM = new int[len];
		String[] line2 = br.readLine().split(" ");
		int[] levelE = new int[len];
		
		for (int i = 0; i < len; i++) {
			levelM[i] = Integer.parseInt(line1[i]) << 12;
			levelE[i] = Integer.parseInt(line2[i]);
		}
		
		out(solve(levelM , levelE));
	}
}
0