Page 4 of 4

Re: 10719 - Quotient Polynomial

Posted: Tue May 11, 2010 11:39 am
by sohel
Option 3) You can verify whether the test cases you have posted are correct using http://uvatoolkit.com/problemssolve.php

Re: 10719 - Quotient Polynomial

Posted: Tue May 11, 2010 9:32 pm
by amishera
That is a pretty cool site.

But it still didn't work. The both outputs match (tested using diff -b). Still WA. I don't understand what else can remain. k can be >0, <0 and ==0. the polynomial can be degree 0, 1, 2, 3, 4. Upto degree 4 polynomial should be representative. That should be all. But what a crap.

Re: 10719 - Quotient Polynomial

Posted: Sat May 14, 2011 7:14 pm
by mliu_buet
@amishera,
You used,
printf("q(x): ");
for (i = 0;i < degree-1;i++)
{
printf("%ld ", q);
}

it should have been,

printf("q(x):");
for (i = 0;i < degree-1;i++)
{
printf(" %ld", q);
}


Thanks

Re: 10719 - Quotient Polynomial

Posted: Sat May 14, 2011 7:21 pm
by mliu_buet
I think you are tired of the input format:(strtok,sscanf,...bla bla)
lets check this out,

//declarations
while(scanf("%d",&k)!=EOF)
{
for(i=0;;i++)
{
scanf("%d",&poly);
if(getchar()=='\n') break;
}

// rest of the code

}



Why wa? Is it because of IO ?

Posted: Sun Jun 15, 2014 12:51 pm
by lighted

Code: Select all

removed code, after acc...

Re: 10719 - Quotient Polynomial

Posted: Mon Jun 16, 2014 9:11 pm
by brianfry713
Don't read and write to files.

Re: 10719 - Quotient Polynomial

Posted: Tue Jun 17, 2014 4:06 pm
by lighted
Oh my God. i am really full. I forgot to remove comments. program was trying to read and write from files. Got acc.

Code: Select all

//  #ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
//  #endif