|
|
Very fun and interesting problem. Although, before solving it I wrote a playable version, which was pretty hard to solve by hand (brain). The problem itself isn't that hard. You don't need any deep mathematical knowledge. Just think about what the move (cross xor) means and find its relation to consequent moves player can make. It's then pretty easy to formulate several theorems that let you write an O(n^2) solution. Help me, pls... I m sure I have right solution, but I always get WA#1... Can anybody tell me what is test #1? I can't understand how can it take 1 sec to solve for N = 1000 My biggest ideas is something like a system of equations by modulo 2, but ... Some hints please... Please one small pour hint Please. I still have any ideas. May be finding of circles? linear module equations will work. try to rewrite it into a simpler form and you will achieve it! I found a lot of material about modular arithmetic itself, but nothing about systems of equations modulo 2. There is a problem 1042 that I solved using an intuitive algo. But I don't have any materials about those kind of problems... Any links in Internet are available. I haven't AC but sure that 1458 is a problem with great mathematical background. In matrix language Sulman command is equal to transformation of tipe A[j]*B*A[k] where A[j]=diag[1,1,1,...,-1,1,1,1,1..] So, read about minimal step of transformations to standard form. Also, sequence of such transformation is code for arbitrary 0-1 matrix. Sure that authors create the problem during reading about 0-1 matrix, transformations and coding. You're A LOOSER.I've done this program to 1 minute!!! Each has It's own way and all of us are training to contests. But even after you words the problem does't seem to me as simple. Often such quick solutions depend on temporary weakeness of tests. Ac after some period! I did'n beleve that O-1 equation method can help. We have 10^6 unknowns and O(10^18) Gauss. But I had expierence for large systems with itteration method(as for Puasson eqution) and this method works here. But after I understood that the matrix of the system is nilpotent because nature of smoothing operator and itteration method has right foundation. Edited by author 10.02.2009 09:24 Well, then, where is your AC for this problem? You have no AC's at all... Just find a way to flip some cell without affecting others. It's easy for even N. Edited by author 03.08.2008 11:31 Just find a way to flip some cell without affecting others. Thanks! Don't use IOSTREAM!!!! CSTDIO is much faster.. May be it's obvious, but solution with no unnecessary moves is unique. I mean that if you get out from sequence pairs of equal moves and sort it you will get the same sequence. So you need to have 2 sequences: one transforming all to black and second - to white. A good hint (though, not so obvious for me). Notice1: There is no differene in the order of operations. for example 1 0 than 2 3 is equal to 2 3 than 1 0 Notice 2: Same operation assumed 2*i times does not change the matrixxx. This is my thoughts. how to output when no solution? What is the answer for test: 3 WWW WBW WWW ? I think 3 hours to got AC I completely agree with you. Edited by author 26.04.2006 20:09 |
|
|