結果

問題 No.2056 非力なレッド
ユーザー ks2mks2m
提出日時 2022-08-26 21:25:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 373 ms / 2,000 ms
コード長 866 bytes
コンパイル時間 2,508 ms
コンパイル使用メモリ 76,376 KB
実行使用メモリ 61,076 KB
最終ジャッジ日時 2024-04-21 23:20:46
合計ジャッジ時間 11,897 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
36,952 KB
testcase_01 AC 57 ms
37,032 KB
testcase_02 AC 57 ms
36,736 KB
testcase_03 AC 60 ms
36,768 KB
testcase_04 AC 57 ms
36,852 KB
testcase_05 AC 55 ms
36,840 KB
testcase_06 AC 57 ms
36,548 KB
testcase_07 AC 55 ms
36,532 KB
testcase_08 AC 52 ms
36,752 KB
testcase_09 AC 58 ms
36,852 KB
testcase_10 AC 57 ms
36,888 KB
testcase_11 AC 56 ms
36,964 KB
testcase_12 AC 54 ms
36,628 KB
testcase_13 AC 296 ms
53,428 KB
testcase_14 AC 300 ms
53,748 KB
testcase_15 AC 280 ms
53,732 KB
testcase_16 AC 132 ms
40,052 KB
testcase_17 AC 239 ms
49,072 KB
testcase_18 AC 101 ms
38,756 KB
testcase_19 AC 130 ms
40,728 KB
testcase_20 AC 346 ms
55,060 KB
testcase_21 AC 161 ms
44,300 KB
testcase_22 AC 294 ms
53,472 KB
testcase_23 AC 260 ms
52,264 KB
testcase_24 AC 206 ms
45,268 KB
testcase_25 AC 364 ms
54,392 KB
testcase_26 AC 373 ms
59,932 KB
testcase_27 AC 355 ms
55,868 KB
testcase_28 AC 341 ms
60,652 KB
testcase_29 AC 334 ms
61,036 KB
testcase_30 AC 345 ms
60,980 KB
testcase_31 AC 332 ms
61,020 KB
testcase_32 AC 334 ms
60,696 KB
testcase_33 AC 337 ms
60,576 KB
testcase_34 AC 342 ms
61,052 KB
testcase_35 AC 337 ms
61,076 KB
testcase_36 AC 334 ms
60,652 KB
testcase_37 AC 349 ms
60,972 KB
testcase_38 AC 51 ms
36,604 KB
testcase_39 AC 51 ms
36,928 KB
testcase_40 AC 53 ms
36,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int n = Integer.parseInt(sa[0]);
		int x = Integer.parseInt(sa[1]);
		int m = Integer.parseInt(sa[2]);
		sa = br.readLine().split(" ");
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		int[] c = new int[n];
		for (int i = 0; i < n; i++) {
			while (a[i] >= x) {
				a[i] /= 2;
				c[i]++;
			}
		}

		int b = 0;
		int max = 0;
		for (int i = n - 1; i >= 0; i--) {
			if (c[i] > max) {
				b += (c[i] - max) * (i + 1);
				max = c[i];
			}
		}
		if (b <= m) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
0