Accepted
Code
#include<bits/stdc++.h>
using namespace std;
#define e4 ios_base::sync_with_stdio(false); cin.tie(NULL)
#define endl '\n'
#define ll long long
#define test_case int tc;cin>>tc;while(tc--)
int main() {
e4;
ll n;
cin>>n;
ll val=sqrt(n);
if(val*(val+1)>n) cout<<(2*val)-1;
else cout<<(2*val);
}
// S m o t h e r e d M a t e !! //
Information
- Submit By
- Type
- Submission
- Problem
- P1191 A. Balanced Product
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-31 20:11:30
- Judged At
- 2025-07-31 20:11:30
- Judged By
- Score
- 100
- Total Time
- 4ms
- Peak Memory
- 532.0 KiB