【水题】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; }
相关文章推荐
- 【模拟】2011 Asia ChenDu Regional Contest 成都现场赛 hdu 4119
- HDU 4115 Eliminate the Conflict(2-SAT)(2011 Asia ChengDu Regional Contest)
- HDU 4087 三维坐标旋转(仿射变换) 矩阵加速 && 2011 Asia Beijing Regional Contest
- [POJ 4001-4010][2011 Asia Fuzhou Regional Contest]2011 ACM 福州赛区现场赛题解(不断更新)
- HDU 4082 Hou Yi's secret 伪相似三角形 && 2011 Asia Beijing Regional Contest
- hdu 4118 Holiday's Accommodation 2011 Asia ChengDu Regional Contest
- hdu 4081 Qin Shi Huang's National Road System(最小生成树+dp)2011 Asia Beijing Regional Contest
- HDU - 4054 Hexadecimal View (2011 Asia Dalian Regional Contest)
- hdu 4055 2011 Asia Dalian Regional Contest
- HDU 4089 Activation(概率DP好题)——2011 Asia Beijing Regional Contest
- hdu 4005 Number String 数列上的DP 【From:2011 Asia Dalian Regional Contest】&& 【SGU489】 Extremal Permutations
- hdu 4112 2011 ACM成都现场赛B
- 【模拟】2011 Asia Fuzhou Regional Contest hdu 4121
- HDU 4112 2011ACM成都现场赛B
- HDU - 4054 Hexadecimal View (2011 Asia Dalian Regional Contest)
- HDU 4063 Aircraft(计算几何)(The 36th ACM/ICPC Asia Regional Fuzhou Site —— Online Contest)
- HDU 5477 A Sweet Journey(本场的最水题,过程处理好是关键)——2015 ACM/ICPC Asia Regional Shanghai Online
- hdu 4038 Stone The 36th ACM/ICPC Asia Regional Chengdu Site —— Online Contest
- hdu4788 水题 Hard Disk Drive (2013 Asia Chengdu Regional Contest problem H)
- The 2011 ACM-ICPC Asia Dalian Regional Contest-D Hexadecimal View 【模拟】