Accepted
Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n;
cin>>n;
long long ans=0;
for(int i=1;i*i<=n;i++)
{
long long temp=i*i;
long long temp1=i*(i+1);
if(temp<=n)
ans++;
if(temp1<=n)
ans++;
}
cout<<ans<<endl;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1191 A. Balanced Product
- Contest
- Brain Booster #10
- Language
- C++11 (G++ 13.2.0)
- Submit At
- 2025-06-13 15:36:59
- Judged At
- 2025-06-13 15:36:59
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB