朱色虫居
Pages
Home
Featured Posts
2006/10/03
10302-Let Me Count The Ways
/*
"Let Me Count The Ways"
Level:0.5
Date:2006/10/2
技巧:根本是考數學,公式是從forum找來的,也不知道為什麼用這公式,
此外input,sum都一定要用long long type 否則會WA.
上傳ACM %I64d要改成%llu
*/
#include
main(){
long long input=0;
long long sum=0;
while(scanf("%I64d",&input)==1){
sum = (input*input*(input+1)*(input+1))/4;
printf("%I64d\n",sum);
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment