Submission #27239

#TimeUsernameProblemLanguageResultExecution timeMemory
27239TAMREF제곱근 구하기 2 (gs13068_sqrt2)C++11
1 / 1
0 ms2032 KiB
#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)

sqrt2.cpp: In function 'int main()':
sqrt2.cpp:6:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld",&n);
                     ^
#Verdict Execution timeMemoryGrader output
Fetching results...