結果

問題 No.3216 Slightly Strong Fairies
コンテスト
ユーザー elphe
提出日時 2025-08-01 21:44:00
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 185µs
コード長 787 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 908 ms
コンパイル使用メモリ 160,996 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-13 16:44:48
合計ジャッジ時間 2,150 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <cstdint>
#include <vector>

static inline constexpr uint_fast32_t prepare(const uint_fast32_t N, const std::vector<uint_fast32_t>& A) noexcept
{
	uint_fast32_t ans = 0;
	for (uint_fast32_t i = 0; i != N; ++i)
		ans += A[i];

	return ans / N;
}

static inline constexpr uint_fast32_t solve(const uint_fast32_t N, const std::vector<uint_fast32_t>& A) noexcept
{
	const uint_fast32_t ave = prepare(N, A);
	uint_fast32_t ans = 0;
	for (uint_fast32_t i = 0; i != N; ++i)
		if (A[i] >= ave + 100)
			++ans;

	return ans;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios::sync_with_stdio(false);
	
	uint_fast32_t N, i;
	std::cin >> N;
	std::vector<uint_fast32_t> A(N);
	for (i = 0; i != N; ++i)
		std::cin >> A[i];

	std::cout << solve(N, A) << '\n';
	return 0;
}
0