Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
just a rephrase of cow's comment/* 4 good guy, 4 bad guy, test 7 as interval instance: 1 2 3 4 5 6 (7) 8 if 7 is good, fail else after killing 7, we re number them as: 1 2 3 4 5 6 7 prev(7) is (still) 6, good guys are still 1~4, bad guys changed a bit the next one to be killed (in new instance) is: next(prev(7), 7), and we still know if it's good/bad so, we can throw old instance and bad guy number, still know if next one is good/bad recursively doing this, we can tell if 7 saves all good guys help: 1. m>k, or good guy will be killed in 1st round 2. m is c(k+1), or c(k+1)+1. because in last round(k good, 1 bad), prev(dead) is k or k+1, m has to be [1+] multiple of k+1 to kill the last 1 bad */ Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator