首页 > ACM题库 > HDU-杭电 > hdu 2626 Samuel’s Schedule待解决[解题报告]C++
2014
02-12

hdu 2626 Samuel’s Schedule待解决[解题报告]C++

Samuel’s Schedule

问题描述 :

Welcome to ‘Samuel Design Contest’.Samuel greets you a happy 牛 Year. At new year and always,may peace and love fill your heart,beauty fill your world,joy and contentment fill your life and may you make great progress during the coming year both in your ACM and your study.
The following problems are intended for you,especially for those rookies(usually known as “vegetable bird”in Chinglish).As it always does,the first problem is the easiest,I believe that you can work it out in a few minutes.
The problem goes like this:
Samuel is engaged at this new year’s season and has a lot of things to do. For instance,he needs to buy new clothes,to prepare some food,to decorate the house and the like. Here is the schedule.

Based on the schedule,you need to answer what will Samuel do in N days before the New Year(2009.1.26 i the Spring Festival).

输入:

The input include 2 parts:
t(an integer,presents the t test cases),n(an integer,means n days before the New Year).

输出:

The input include 2 parts:
t(an integer,presents the t test cases),n(an integer,means n days before the New Year).

样例输入:

3
13
3
2

样例输出:

Samuel will take test.
Samuel will stay at home.
Samuel will decorate.


  1. 5.1处,反了;“上一个操作符的优先级比操作符ch的优先级大,或栈是空的就入栈。”如代码所述,应为“上一个操作符的优先级比操作符ch的优先级小,或栈是空的就入栈。”

  2. 你的理解应该是:即使主持人拿走一个箱子对结果没有影响。这样想,主持人拿走的箱子只是没有影响到你初始选择的那个箱子中有奖品的概率,但是改变了其余两个箱子的概率分布。由 1/3,1/3 变成了 0, 2/3