http://acm.hdu.edu.cn/showproblem.php?pid=4112
纯粹的数学处理,没有数学知识基本上就没辙了。。
具体代码:
View Code
#include<cstdio> #include<cmath> int main() { __int64 n,m,k,t,cas=0; scanf("%I64d",&t); while(t--) { scanf("%I64d%I64d%I64d",&n,&m,&k); printf("Case #%I64d: %I64d %I64d\n",++cas,n*m*k-1,(__int64)(ceil(log(n*1.0)/log(2.0))+ceil(log(m*1.0)/log(2.0))+ceil(log(k*1.0)/log(2.0)))); } return 0; }
