Compile Error
foo.cc: In function 'void solve()': foo.cc:20:14: error: 'sqrtll' was not declared in this scope; did you mean 'sqrtl'? 20 | ll num = sqrtll(n); | ^~~~~~ | sqrtl
Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll binpow(ll a, ll b, ll m) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a % m;
a = a * a % m;
b >>= 1;
}
return res;
}
void solve(){
ll n;
cin>>n;
ll num = sqrtll(n);
if (num*num==n){
cout<<2*num-1<<endl;
}
else{
cout<<2*num<<endl;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll tt;
tt =1;
while(tt--){
solve();
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1191 A. Balanced Product
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-14 11:07:00
- Judged At
- 2025-07-14 11:07:00
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes