Accepted
Code
#include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
long long count = 0;
for (long long i = 1; ; i++) {
long long a = i * i;
long long b = i * (i + 1);
if (a > n && b > n)
break;
if (a <= n){
count++;
}
if (b <= n){
count++;
}
}
cout << count << endl;
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:52:12
- Judged At
- 2025-06-13 15:52:12
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 532.0 KiB