There's something weird about this problem. After getting WA I went to the UVA toolkit site and checked several queries to see what my mistake was. This is what I found:
The input file will contain several lines of inputs. Each line contains non-negative integers R(R<=10000) and N (1<=N<=100) as described before. Input is terminated by end of file.
It's quite obvious that N is positive but what about R? Do you handle R=0? Well, I ...
Thanks sohel. Very useful tool. I managed to find an error: I wasn't marking all the new eliminated candidates before giving away their ballots, so I could give a ballot to a candidate who was going to be eliminated later in the same iteration :oops: Anyway, I'm still getting WA, don't know why ...
I've been trying to get this problem AC for a few days now and there is no way. My solution is really simple, as I think the problem is too, but no matter how hard I try I can't find out what I'm doing wrong.
What if there's no ballots? I guess all the candidates tie with 0 votes and ...
My output is the same as LayCurse for (2,0), that is, 13322980 + 18554528
I don't think the i/o is wrong, otherwise it couldn't have been solved by Alberto.
Thanks Jan for the I/O files. They really helped me a lot!
However, I must say that my AC program doesn't produce *exactly* the same output as the sample output file, so it's not necessary to make them match perfectly. You can use them as a guide, though.
I'm also stuck with this problem. I have dozens of WA's and my algorithm is just a simple backtracking. Anyone have got AC in the last few months? The success rate for this problem is surprisingly low for such an easy task.
Don't know if i'm the only one that think like this but, anyway, i must say it! The new system is up for almost a year now and we haven't seen any of the "amazing" features devised for it yet. I was wondering if the OJ site is still under development or if it's frozen for some reason at ...