# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
27239 | TAMREF | 제곱근 구하기 2 (gs13068_sqrt2) | C++11 | 0 ms | 2032 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n,a;
double ans;
scanf("%lld",&n);
a=(long long)sqrt(n);
if(n-a*a>a){
++a;
ans=(1.-(double)(a*a-n)/(2*a*a))*a;
}else{
ans=(1.+(double)(n-a*a)/(2*a*a))*a;
}
printf("%.6f\n",ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |