[bzoj1349][Baltic2006]Squint 大水题

来源:互联网 发布:matlab 四维矩阵 画图 编辑:程序博客网 时间:2024/05/01 14:04

1349: [Baltic2006]Squint

Time Limit: 1 Sec  Memory Limit: 64 MB
[Submit][Status][Discuss]

Description

Write a program to calculate integer square roots.

Input

The input is read from a text file named squint.in. Its only line consists of an integer 0 < = n < 2^63 .

Output

Its only line consists of the smallest nonnegative integer q such that q^2 >= n .

Sample Input

122333444455555

Sample Output

11060446

HINT

sqrt(122333444455555)=11060445.038765619 .

Source

除了1000最水的题
#include<cstdio>#include<cmath>long long a,b;int main(){scanf("%lld",&a); b = sqrt(a); b = b*b<a?b+1:b;printf("%lld",b); return 0;}


原创粉丝点击