您的位置:首页 > 其它

【水题】2011 Asia ChenDu Regional Contest 成都现场赛 hdu 4112

2011-11-09 15:25 615 查看
水题,手切的次数是固定的,n*m*k-1,刀切最小是每条边长取2的对数,再ceil一下,相当于每次对折一样。

#include <map>
#include <set>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <time.h>
#include <cstdio>
#include <math.h>
#include <iomanip>
#include <cstdlib>
#include <limits.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;

#define LL long long
#define MIN INT_MIN
#define MAX INT_MAX
#define PI acos(-1.0)
#define FRE freopen("input.txt","r",stdin)
#define FF freopen("output.txt","w",stdout)
int main () {FRE;
LL n,m,k;
int t;
int ca = 1;
while(scanf("%d",&t) != -1) {
while (t--) {
scanf("%I64d%I64d%I64d",&n,&m,&k);
LL a = n*m*k - 1;
LL b = ceil(log(n*1.0)/log(2.0)) + ceil(log(m*1.0)/log(2.0)) + ceil(log(k*1.0)/log(2.0));
printf("Case #%d: %I64d %I64d\n",ca++,a,b);
}
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐