@kevinsogo : Please, provide me test cases where this solution fails.
Somebody plz tell me the problem with this answer.i am getting wrong answer.i tried everything
http://www.codechef.com/viewsolution/7068018
Somebody plz tell me the problem with this answer.i am getting wrong answer.i tried everything CodeChef: Practical coding for everyone
My soln can anybody clarify the testcase it will fail, my code is here nDTg7t - Online C++0x Compiler & Debugging Tool - Ideone.com
thank you in advance
P.S. i just need a test case on which it fails.
https://www.codechef.com/viewsolution/14414054
can someone tell what is wrong with my code i am using the simple algorithm for switching the no. if a[i] == i
i am still betting wrong answer
Hi , i don’t know if anyone has done this question in this way or not ,but here is my solution :
https://www.codechef.com/viewsolution/19279294
I have just continuously assigned each voter to the candidates in the same order 0,1,…n-1 , and if the voter and the candidate turn out to be same, i have matched them with the next one .In this way ,what happens is there are only two possibilities either one of them is left with self voting or no one . if only one of them is left(say x) , we can easily just find a voter(say a) who didn’t vote x and voted y and change the array in this way :- x voted a, and a voted y. in this way , the remaining vote of a is used up and everything else remains in the same order .
oh, thats cool I also once used max flow in tc for Div 2 level 2 problem
yes me too… it is much cleaner
Yes, I know this problem but forgot its name. Thanks!
I felt somewhat bad after seeing somewhat uglier in heading, when your solution description starts.
I edited it. Thanks
By the way, I have removed the graph terms for the most part of the editorial so it’s simpler to read.
Try the case n = 3, c1 = 0, c2 = 1 and c3 = 2 . Your code will assign 1 to 2, but the only solution is to assign 1 to 3, 2 to 3 and 3 to 2.
Please help with what’s wrong with my solution.
Solution Link: CodeChef: Practical coding for everyone
somebody please check my solution i don’t know why i m getting wa.
int this for every guy for i!=1 he is giving vote to the preceding person and i=1 is giving the vote to the last person who needs a vote .
why anyone is not using linked list
??