Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这道题的陷阱是为"max min"做法而设的(内详)

Posted by deathado at 2008-05-18 03:11:18 on Problem 2328
如果将每次猜测的结果都存起来,然后依次判断有无与right on的数矛盾的。这样无论系统出什么样的数据都无法影响max min的值(因为根本没有这两个值)

1.循环输入整数,字符串,直到right on出现
2.从第一次猜测结果依次向下判断:
若在一次的猜测当中出现N(i)>N(right)而且Message(i)=too low
或者N(i)<N(right)且Message(i)=too high 那就是矛盾了。

我一开始想到的是这种方法,不过没试过用这种方法提交,因为开数组后的控制较麻烦且程序段稍长,所以用"max min",可惜还给陷了几次。。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator