ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1003. Parity

melkiy Please share your solution with me [5] // Problem 1003. Parity 28 Sep 2009 02:08
Please, who solved this problem with disjoint sets send me your solution to the e-mail which is in my profile.
I wrote the code and it gives right answers on many tests, but not passes here. I need to compare where an error is.
melkiy Re: Please share your solution with me [2] // Problem 1003. Parity 8 Oct 2009 03:25
Thanks to all, no need anymore. I AC.

For those who has not overcame the problem, i repeat (based on all of the advices i've read here) breafly where you may be wrong

1) if b>length, the friend lies

2) number of questions can be wrong. I read line by line and analyze if there is only one "word" or three. So, to determine where the next test begins i do NOT do like
for(i=0; i<answers; ++i)
but like
while(scanf("%d%d%s",&a,&b,&oddeven) == 3)
icanwin Re: Please share your solution with me [1] // Problem 1003. Parity 16 Oct 2009 04:41
But so you all will receive 2 words from next lines, except for last ones.
melkiy Re: Please share your solution with me // Problem 1003. Parity 16 Oct 2009 22:29
icanwin, of course i would. But if to be more precisely i do like this:

gets(buf);
if(sscanf(buf, "%d%d%s", &a, &b, oddeven) == 1)
{
  if a == -1 then the end of input
  else a new test begins
}
surajkvm007 Re: Please share your solution with me // Problem 1003. Parity 31 Oct 2013 22:46
can you please share your solutions with me
ძამაანთ [Tbilisi SU] Re: Please share your solution with me // Problem 1003. Parity 29 Mar 2014 23:17
could you please share your solutions with us?