/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 2ms 324.0 KiB
#3 Accepted 3ms 540.0 KiB
#4 Accepted 2ms 344.0 KiB
#5 Accepted 47ms 560.0 KiB
#6 Time Exceeded ≥1074ms ≥332.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;

/*#ifndef ONLINE_JUDGE
#include "DEBUG.h"
#define bug(...)           __f (#__VA_ARGS__, __VA_ARGS__)
#endif*/

#define first_in_out       ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int                 long long int
#define double             long double
#define print(a)           for(auto x : a) cout << x << " ";
#define printpair(a)       for(auto x : a) cout << x.first << " " << x.second<<"\n";



void solve()
{

	int n;
	cin >> n;
	int cnt = 0;

	for (int i = 1; i <= n; i++)
	{
		if (1ll * i * i <= n)
			cnt++;
		if (1ll * i * (i + 1) <= n)
			cnt++;

	}

	cout << cnt << "\n";
}


int32_t main()
{
	first_in_out

	int t = 1;
	//cin >> t;

	while (t--)
		solve();

}

Information

Submit By
Type
Submission
Problem
P1191 A. Balanced Product
Contest
Brain Booster #10
Language
C++17 (G++ 13.2.0)
Submit At
2025-06-13 15:34:50
Judged At
2025-06-13 15:34:50
Judged By
Score
80
Total Time
≥1074ms
Peak Memory
≥560.0 KiB