結果

問題 No.3037 トグルトグルトグル!
コンテスト
ユーザー elphe
提出日時 2025-03-02 11:42:22
言語 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
コード長 355 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 869 ms
コンパイル使用メモリ 158,952 KB
実行使用メモリ 5,760 KB
最終ジャッジ日時 2026-07-06 22:05:42
合計ジャッジ時間 1,972 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

using namespace std;

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

	uint64_t N;
	cin >> N;

	uint32_t l = 0, r = 1'000'000'001;
	while (l + 1 < r)
	{
		const auto c = (l + r) >> 1;
		if (static_cast<uint64_t>(c) * c <= N) l = c;
		else r = c;
	}

	cout << l << '\n';
	return 0;
}
0