結果

問題 No.207 世界のなんとか
コンテスト
ユーザー elphe
提出日時 2025-09-21 20:21:14
言語 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 / 5,000 ms
+ 368µs
コード長 668 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,008 ms
コンパイル使用メモリ 334,016 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-15 04:32:20
合計ジャッジ時間 3,294 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

[[nodiscard]] static inline constexpr std::vector<uint_least32_t> solve(const uint_fast32_t A, const uint_fast32_t B) noexcept
{
	std::vector<uint_least32_t> ans;
	ans.reserve(B - A);
	for (uint_fast32_t i = A; i <= B; ++i)
		if (i % 3 == 0 || std::to_string(i).find('3') != std::string::npos)
			ans.push_back(i);

	return ans;
}

static inline void output(const std::vector<uint_least32_t>& ans) noexcept
{
	for (uint_fast32_t i = 0; i != ans.size(); ++i)
		std::cout << ans[i] << '\n';
}

int main()
{
	std::cin.tie(nullptr);
	std::ios::sync_with_stdio(false);

	uint_fast32_t A, B;
	std::cin >> A >> B;

	output(solve(A, B));
	return 0;
}
0