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

我的一个思路(新手,请大牛指教)

Posted by erichui at 2008-09-02 23:40:07 on Problem 1013
把数据分为三组,真,重,轻
我们先假设假币'X'为重(轻类推)
那么根据假币只有一个,所以每一组重中都有'X'(只需遍历heavy[0]即可),真和轻中都没有‘X',
根据一定有唯一解,那么符合这个条件的一定是假币。
以上思路用string中的find函数实现起来非常容易,时间肯定是0ms

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