I know it's hard to read somebody else's code but I was the whole contest trying to solve problem C (mutexes) and I couldn't get more than a Wrong Answer. It was very hard for me as I couldn't compile locally so it was very hard to test but my last submission I thought was bugless and I couldn't find its bug even 2 hours after the contest ended.
Here's the link to my solution http://pastebin.com/3dKPMMva And here's the explanation of what I did in case somebody reads it and wants to help me find a bug Node 0 is like a master node. The first thing I do is get sqrtnodes (3 if nodes == 10 and 9 if nodes == 100) and divide both sequences in sqrtnodes subsequences, and I call for each subsequence of mutex operations a different node to get what mutexes I request and release during that subsequence (if I request and then release or viceversa it's like doing nothing on that subsequence) then I get for each prefix of subsequences which mutexes I have on each of the processes. Then I divide in sqrtnodes * sqrtnodes cases and that's for each pair of subsequences I analize each pair of requests and check if I have no mutexes in common (as if I do there's no way I can get to that part at the same time) and if each process has the mutex the other node is requesting. If somebody wants to help me finding my bug I'll really appreciate it! Thanks in advance!! Leo.- -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/CA%2BE_-jSMV6YTHFPS8tJPo5BeJ56nczTN6Ty7B2qxpML9N69D%3DQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
