这是一道经典的DP模板题. https://vjudge.net/problem/POJ-3783#author=Herlo 一开始也是不知道咋写,尝试找了很多博客,感觉有点领悟之后写下自己的理解. 题意就是: 对于一种蛋,如果它在第m层楼摔不碎,但是在第m+1层摔碎了,那么它的硬度就是m. 有若干层楼,你有若干个一样的蛋,你每一次尝试的结果都会是最坏的情况,问你在这种运气最差的情况下至少丢几次蛋才能知道它的硬度. A. 如果蛋的数量是0,那根本都尝试不了,只能试0次 B. 如果你只有一个蛋,那…
input T 1<=T<=10000 n m 1<=n<=2000000007 1<=m<=32 output m个鸡蛋从1到n哪一楼x扔下去刚好没碎,而再x+1楼扔下去就碎了,求最少扔的次数无论x为1到n的哪个数都能确定x 如果x>32,输出Impossible,否则输出x 做法:dp,d(x,y)=d(x,y-1)+d(x-1,y-1),x:egg,y:floor求出下限,即x个鸡蛋至少要试多少次 # include <stdio.h> # in…
链接 Chernobyl’ Eagle on a Roof 题意 引用论文题意:有一堆共 M 个鹰蛋,一位教授想研究这些鹰蛋的坚硬度 E.他是通过不断从一幢 N 层的楼上向下扔鹰蛋来确定 E 的.当鹰蛋从第 E 层楼及以下楼层落下时是不会碎的,但从第(E+1)层楼及以上楼层向下落时会摔碎.如果鹰蛋未摔碎,还可以继续使用:但如果鹰蛋全碎了却仍未确定 E,这显然是一个失败的实验.教授希望实验是成功的.例如:若鹰蛋从第 1 层楼落下即摔碎,E=0:若鹰蛋从第 N 层楼落下仍未碎,E=N.这里假设所有的…
What number should I guess next ? 这篇文章的灵感来源于最近技术部的团建与著名的DP优化<鹰蛋>.记得在一个月前,查到鹰蛋的题解前,我在与同学讨论时,一直试图寻找一种固定的模式来决策.但是,却总存在更理想的方案.在此,我想以团建的游戏作为背景,系统(sui bian)地描述和分析在这些决策模式. 又或者说,我想试着介绍的是: THE FUN OF DECISION 思维游戏与决策的魅力 本文前半部分的受众可以是没接触过OI但是学过高中数学的.正在或想要接触计算机…
6.5 There is a building of 100 floors. If an egg drops from the Nth floor or above, it will break. If it's dropped from any floor below, it will not break. You're given two eggs. Find N, while minimizing the number of drops for the worst case 这道题说有10…
4554 BallsThe classic Two Glass Balls brain-teaser is often posed as:“Given two identical glass spheres, you would like to determine the lowest floor in a 100-storybuilding from which they will break when dropped. Assume the spheres are undamagedwhen…
题目原文: Suppose that you have an n-story building (with floors 1 through n) and plenty of eggs. An egg breaks if it is dropped from floor T or higher and does not break otherwise. Your goal is to devise a strategy to determine the value of T given the…
The classic Two Glass Balls brain-teaser is often posed as: “Given two identical glass spheres, you would like to determine the lowest floor in a 100-story building from which they will break when dropped. Assume the spheres are undamaged when droppe…
Balls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1196 Accepted: 783 Description The classic Two Glass Balls brain-teaser is often posed as: "Given two identical glass spheres, you would like to determine the lowest floor in a 100-…