Accepted
Code
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, res; cin >> n;
x = sqrt(n);
res = x;
if (x * (x + 1) > n) res += x - 1;
else res += x;
cout << res << endl;
}
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:51
- Judged At
- 2025-06-13 15:34:51
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 736.0 KiB