`
lilisalo
  • 浏览: 1125045 次
文章分类
社区版块
存档分类
最新评论

HDU 4112 2011ACM成都现场赛B

 
阅读更多

Break the Chocolate

Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 46Accepted Submission(s): 12


Problem Description

Benjamin is going to host a party for his big promotion coming up.
Every party needs candies, chocolates and beer, and of course Benjamin has prepared some of those. But as everyone likes to party, many more people showed up than he expected. The good news is that candies are enough. And for the beer, he only needs to buy some extra cups. The only problem is the chocolate.
As Benjamin is only a 'small court officer' with poor salary even after his promotion, he can not afford to buy extra chocolate. So he decides to break the chocolate cubes into smaller pieces so that everyone can have some.
He have two methods to break the chocolate. He can pick one piece of chocolate and break it into two pieces with bare hand, or put some pieces of chocolate together on the table and cut them with a knife at one time. You can assume that the knife is long enough to cut as many pieces of chocolate as he want.
The party is coming really soon and breaking the chocolate is not an easy job. He wants to know what is the minimum number of steps to break the chocolate into unit-size pieces (cubes of size 1 × 1 × 1). He is not sure whether he can find a knife or not, so he wants to know the answer for both situations.

Input
The first line contains an integer T(1<= T <=10000), indicating the number of test cases.
Each test case contains one line with three integers N,M,K(1 <=N,M,K <=2000), meaning the chocolate is a cube of size N ×M × K.

Output
For each test case in the input, print one line: "Case #X: A B", where X is the test case number (starting with 1) , A and B are the minimum numbers of steps to break the chocolate into N × M × K unit-size pieces with bare hands and knife respectively.

Sample Input
2 1 1 3 2 2 2

Sample Output
Case #1: 2 2 Case #2: 7 3

Source
这是现场赛最简单的一道,很多牛校在很短的时间内就AC了
不过题目有个trick,就是要超int
我的代码:

分享到:
评论

相关推荐

    hdu_ACM.rar_ACM_hdu_hdu acm_hdu_ACM_杭电ACM

    杭电hdu acm资料所用杭电的acm题

    hdu_acm_1084.rar_ACM_HDU10_acm10_hdu_hdu 1084

    【标题】"hdu_acm_1084.rar_ACM_HDU10_acm10_hdu_hdu 1084" 提供的是一个关于杭电(HDU)ACM竞赛第1084题的解决方案。该题目可能是在编程竞赛中常见的算法问题,而ACM(国际大学生程序设计竞赛)是全球知名的编程...

    HDU_2010.rar_hdu 2010_hdu 20_hdu acm20

    【标题】"HDU_2010.rar"是一个压缩包文件,其中包含了与"HDU 2010"相关的资源,特别是针对"HDU ACM20"比赛的编程题目。"hdu 2010"和"hdu 20"可能是该比赛的不同简称或分类,而"hdu acm20"可能指的是该赛事的第20届...

    ACM HDU题目分类

    ACM HDU 题目分类 ACM HDU 题目分类是指对 HDU 在线判题系统中题目的分类,总结了大约十来个分类。这些分类将有助于编程选手更好地理解和解决问题。 DP 问题 DP(Dynamic Programming,动态规划)是一种非常重要...

    HDU_ACM培训课件(完整版)

    HDU_ACM培训课件是面向参与ACM(国际大学生程序设计竞赛,International Collegiate Programming Contest,简称ICPC)的学员准备的一套完整的教程资源。这个压缩包包含了丰富的学习资料,旨在帮助参赛者提升编程技能...

    ACM HDU

    【ACM HDU】指的是在ACM(国际大学生程序设计竞赛,International Collegiate Programming Contest)中,参赛者在杭州电子科技大学(Hangzhou Dianzi University,简称HDU)的在线评测系统上完成并已解决的题目集合...

    HDU.rar_hdoj 2000 2999 chm_hdoj 2000-2099_hdu_hdu acm 20_杭电ACM

    这份名为"HDU.rar"的压缩包文件,包含了针对杭电(Hangzhou Dianzi University,简称HDU)ACM竞赛平台上的2000至2099号题目的一系列解题报告。这些报告以".chm"(Compiled Help Manual)格式存储,是专门为ACM(国际...

    hdu acm 教案(7)

    HDU ACM教案是针对ACM/ICPC(国际大学生程序设计竞赛)的训练教程,旨在帮助参赛者提升算法和编程技能。"搜索入门"这部分内容是教程中的一个重要章节,主要介绍在解决算法问题时如何有效地运用搜索策略。在这个章节...

    HDU-ACM课件.rar

    HDU-ACM课件.rar 是一个专门为编程竞赛爱好者准备的资源包,主要涵盖了ACM(国际大学生程序设计竞赛)中常见的算法知识。这个压缩包包含了一系列与算法相关的主题,旨在帮助初学者理解和掌握基础及进阶算法。下面将...

    hdu acm 教案(3)

    HDU ACM教案是针对ACM/ICPC(国际大学生程序设计竞赛)的训练教程,旨在提升参赛者在算法和编程方面的能力。动态规划是计算机科学中一种强大的问题解决方法,尤其在处理最优化问题时非常有效。在这个教案中,我们将...

    HDU杭电ACM课件完整打包

    【标题】"HDU杭电ACM课件完整打包"是一个专门为ACM竞赛初学者准备的资源集合,其中包含了杭州电子科技大学(HDU)的ACM竞赛相关课程资料。这个压缩包提供了丰富的学习材料,旨在帮助新手快速入门并提升算法和编程...

    hdu+acm课件

    最后,"HDU+ACM课件"可能是一个综合性的课件集合,涵盖了ACM竞赛的各种主题,包括数据结构、算法、问题解决策略等。这是一份全面的学习资料,对于系统性地学习ACM知识非常有价值。 通过学习这些文件,你可以深入...

    hdu acm 2010多校联合(10)1009

    【标题】"hdu acm 2010多校联合(10)1009" 是2010年ACM/ICPC(国际大学生程序设计竞赛)多校联合比赛的第十场比赛中的一道题目,编号为1009。这道题目涉及到算法竞赛中的常见问题解决策略,通常在这样的比赛中,...

    HDU acm-PPT课件

    【ACM入门与提高:HDU ACM竞赛课程详解】 ACM(国际大学生程序设计竞赛,International Collegiate Programming Contest,简称ICPC或ACM/ICPC)是一项全球性的竞赛,旨在激发大学生对计算机科学的兴趣,提升他们的...

    杭电ACMhdu1163

    【标题】:杭电ACMhdu1163 【描述】:这是一道源自杭州电子科技大学(Hangzhou Dianzi University,简称HDU)的ACM编程竞赛题目,编号为1163。这类问题通常需要参赛者利用计算机编程解决数学、逻辑或算法上的挑战,...

    (HDUACM201303版_07)背包专题

    杭电ACM课件2014版之 (HDUACM201303版_07)背包专题

    acm课件 HDU 算法大全

    acm 技术大牛 课件 HDU 自学必备课件 全套齐全 (lecture_01)初识ACM (lecture_02)简单数学题 (lecture_03)递推求解 (lecture_04)动态规划(1)_ (lecture_05)计算几何基础_ (lecture_06)母函数 (lecture_...

    (HDUACM2010版_08)母函数

    (HDUACM2010版_08)母函数(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数(HDUACM2010版_08)母函数

    hdu-acm源代码(上百道源代码)

    首先,HDU(杭州电子科技大学)是举办ACM/ICPC区域赛的高校之一,其在线判题系统HDU-ACM平台提供了大量的编程题目供参赛者练习。这些题目涵盖了算法的各个领域,如图论、动态规划、搜索算法、数学问题、字符串处理等...

Global site tag (gtag.js) - Google Analytics