Submission #4784

#TimeUsernameProblemLanguageResultExecution timeMemory
4784gs13068제곱근 구하기 2 (gs13068_sqrt2)C++98
1 / 1
0 ms1088 KiB
#include<cstdio> int main() { long long i,n; scanf("%lld",&n); for(i=1;i*i<=n;i++); if((n-(i-1)*(i-1))*(2*i)+(i*i-n)*(2*(i-1))<(2*(i-1))*(2*i))printf("%lld.%06lld",i-1,((n-(i-1)*(i-1))*1000000+(i-1))/(2*(i-1))); else printf("%lld.%06lld",i-1,((2*i-i*i+n)*1000000+i)/(2*i)); }
#Verdict Execution timeMemoryGrader output
Fetching results...