|
|
вернуться в форумPlease share your solution with me Послано melkiy 28 сен 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. Re: Please share your solution with me Послано melkiy 8 окт 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) Re: Please share your solution with me But so you all will receive 2 words from next lines, except for last ones. Re: Please share your solution with me Послано melkiy 16 окт 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 } Re: Please share your solution with me can you please share your solutions with me Re: Please share your solution with me could you please share your solutions with us? |
|
|