Accepted
Code
#include<bits/stdc++.h>
#define ll long long
#define int long long
using namespace std;
void solve()
{
int n; cin>>n;
int ans=0;
if(n==1){
cout<<1<<endl;return;
}
for(int i=1;i<n;i++)
{
if(i*i>n) break;
if(i*i<=n)ans++;
if(i*(i+1)<=n)ans++;
}
cout<<ans<<endl;
}
main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
solve();
return 0;
}
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:35:56
- Judged At
- 2025-06-13 15:35:56
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB