結果

問題 No.207 世界のなんとか
ユーザー elphe
提出日時 2025-09-21 20:21:14
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 668 bytes
コンパイル時間 3,058 ms
コンパイル使用メモリ 278,904 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-21 20:21:18
合計ジャッジ時間 4,291 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#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