10 RGRGRBGBGB Possible answer: 7 4 6 3 6 2 6 1 6 1 7 1 8 1 9 My program passed all tests, which I found here or invented myself, but I have WA4. Can anybody help me find a mistake or give some special tests? I'd be very grateful... -- P.S. Already solved. This test helped me: 5 RGBRB Edited by author 27.04.2016 20:49 Can anyone give me some tricky tests? 5 RGRBG 7 RBGBRGB 6 RGBGRB 4 RRBG I got AC with O(N*N); Idea: use mathematical induction and prove that solution exist always. Induction gives a solution. Good hint! Furthermore, it can be proved that if it is not 'obviously impossible', then there will always be a solution. Is there some special inputs in test6? One stack is bad. But N stacks... =) I got AC with O(n^3) solution, based on DP. I suppose, that testcases are too weak. Anyway, I think, that it's not normal to get AC for O(n^3) solution. ) My solution is n3, but it doesn't have to check all posibilities. Some part of array f[][] is never used. Besides, I don't know a better way. It is not O(n^3): the expected number of tests for each sub-interval is 2 and thus DP is O(n^2). My mail: bsc98001@yahoo.com > My mail: bsc98001@yahoo.com Try to eliminate all RGB consecutive but be aware to not "destroy" a rare node (i.e. eliminate them in descending order) What seems to be O(n^3) DP is AC as far as you remember to use "break" ?? who can help me? thanks a lot. From moment of creation of this problem (16 Feb 2002) and till 6 Jun 2006 there was no solution that uses more than 1Mb of memory. I think that original ML was 1 Mb. Now problem has ML 16 Mb, and there are ~40 solutions (<10% of all) that use more than 1 Mb. Is it possible to lower memory limit of this problem to 1 Mb? 1Mb does not allow DP table of size N*N/2 of 2-byte integers. Following you logic, let's instead increase N to, say, 5000. It's not correct to change rules of the game after they were established and some authors ACed solutions under new limitations! Beauty of this problem in that it looks like trivial DP but can be solved using original algorithm much more effective. There is no much sense in having one more standard DP problem. But there is much more benefit for solvers in creating absolutely new algorithm and obtaining new knowledge. I think that current state is fault of people who 2 years ago increased ML for almost all problems not thinking of side effects. As result some problems become meaningless and silly. I think that 2 years is not so long time, and its possible to return meaning to problems that lost it after ML increase. Following you logic, let's instead increase N to, say, 5000. I considered this idea. To create new problem with the same statement and greater limitations. But after problem statistics analysis (<10% solutions would fail that new problem) I came to conclusion that it would be better to remove AC from 10% than force 90% to submit identical solutions to two problems. Please,if you can,give me on C++ this programm #1181!!!I very need!Thank you very much!!! During first rejudge 37 authors lost AC. Tests and validator will be updated soon. Edited by author 10.01.2007 21:32 12 more submits lost AC. Thanks to Alexander Toropov for new validator and tests! Is that true that we should output "0" if: 1) There are less than three colors in the polygon. 2) Vertex of one color is followed by the vertex of the same color (like "GG")? There is no "0" at all! Because all these situation are discribed in the task!)) I got WA all the time. here is one test : 10 BGBGRBBGRG I think the answer is 0 . But the AC solution said it's possible . I'm puzzle. Who can tell me why ? Everything is possible! Just think better. Solution is 0. There is edge with 2 blue vertices: BGBGR[BB]GRG This problem is about invariant(some condition that remains true in spite of any modification). You need to pick diagonals one by one,just making sure that the "condition" is still true... I hope this helps you think in the right direction 8-) |
|