結果

問題 No.2056 非力なレッド
ユーザー square1001square1001
提出日時 2022-08-26 23:03:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 597 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 33,408 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-04-22 01:06:53
合計ジャッジ時間 2,251 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 5 ms
5,376 KB
testcase_14 AC 5 ms
5,376 KB
testcase_15 AC 5 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 4 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 6 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 5 ms
5,376 KB
testcase_23 AC 5 ms
5,376 KB
testcase_24 AC 3 ms
5,376 KB
testcase_25 AC 6 ms
5,376 KB
testcase_26 AC 6 ms
5,376 KB
testcase_27 AC 6 ms
5,376 KB
testcase_28 AC 6 ms
5,376 KB
testcase_29 AC 7 ms
5,376 KB
testcase_30 AC 7 ms
5,376 KB
testcase_31 AC 7 ms
5,376 KB
testcase_32 AC 6 ms
5,376 KB
testcase_33 AC 6 ms
5,376 KB
testcase_34 AC 7 ms
5,376 KB
testcase_35 AC 6 ms
5,376 KB
testcase_36 AC 7 ms
5,376 KB
testcase_37 AC 7 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>

int readint() {
	int res = 0;
	char c = getchar_unlocked();
	while ('0' <= c && c <= '9') {
		res = res * 10 + int(c - '0');
		c = getchar_unlocked();
	}
	return res;
}

int main() {
	int N = readint();
	int X = readint() + 1;
	int M = readint();
	int p[32];
	for (int i = 0; i < 32; i++) {
		p[i] = 0;
	}
	for (int i = 1; i <= N; i++) {
		int a = readint();
		if (a >= X) {
			p[__builtin_clz(a / X)] = i;
		}
	}
	int cost = 0;
	for (int i = 1; i <= 31; i++) {
		p[i] = (p[i] > p[i - 1] ? p[i] : p[i - 1]);
		cost += p[i];
	}
	printf(cost <= M ? "Yes\n" : "No\n");
	return 0;
}
0