|
|
what is 5th test ? Edited by author 07.02.2010 03:04 I also got WA on the 5th test...Who can help me... man-bear-pig 10/20 170/680 3/12 Same answer as for man-bear-pig 1/2 1/4 1/4 Great thanks for this helpful test. input: man-bear-pig 1/2 1/4 1/4 output: 7 man man pig bear 1 2 3 4 5 6 input: man-bear-pig 1/2 1/4 1/4 output: 5 man bear pig 2 3 1 4 Are both of answers correct? input: man 1/1 output: 7 man man man man 1 2 3 4 5 6 Is this answer correct? I know it's something about vector of fractions,but don't know how. Could anyone explain the solution please? 1) We can only make fractions of form a / 2^b where a is odd (this is obvious, you can prove it by induction for example) 2) If all fractions have this form then we can simply build full binary tree. Number of leaves will be equal to the largest denominator and creatures in leaves can be determined quite easily. In fact, problem is easy because we aren't asked to find minimal answer. I don't understand, why only 96 authors got ac. Oh. May be you can help to other users get AC after your hint, your words about "only 98 authors" nobody will help. Author said very much for your! He said that there is strict ,simpe ans easy way for solution. It is not right any times. I used divide & conquer algo on vector of fractions. Can you show me an easier way? Question in topic. I am wondering because my soution was testing for like 60 seconds, there were no other solutions in queue, and "execution time" was 0.031 seconds... cheсking answer takes a long time I always crash on that test...float point wrong After 3 test use a/b=>(a/nod(a,b))/(b/nod(a,b)) To the English reader it will be not clear. It is necessary to write GCD. I still have WA on test 18 after many efforts. Does anyone know some tricks about this test? My program gives right answers on all my tests. Can anyone give me more tests? |
|
|