朱色虫居
Pages
Home
Featured Posts
2006/10/16
10784-Diagonal
/*
"Diagonal"
Level:2.0
Date:2006/10/15
技巧: 我不知道這個公式怎麼推論出來的,也懶得Google了,
直接從論壇上copy公式..XD
*/
#include
#include
main(){
long long unsigned input=0;
int n=0;
while(1){
/* %I64u要改成%llu */
scanf("%I64u",&input);
if(input==0) break;
printf("Case %d: %d\n",++n, (int)ceil(1.5+sqrt(2.0*input)));
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment