## 10719 - Quotient Polynomial

Moderator: Board moderators

sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

### Re: 10719 - Quotient Polynomial

Option 3) You can verify whether the test cases you have posted are correct using http://uvatoolkit.com/problemssolve.php

amishera
New poster
Posts: 38
Joined: Sat Dec 27, 2008 10:42 pm

### Re: 10719 - Quotient Polynomial

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.

mliu_buet
New poster
Posts: 2
Joined: Sat May 14, 2011 7:01 pm

### Re: 10719 - Quotient Polynomial

@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

mliu_buet
New poster
Posts: 2
Joined: Sat May 14, 2011 7:01 pm

### Re: 10719 - Quotient Polynomial

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

}

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

### Why wa? Is it because of IO ?

Code: Select all

``removed code, after acc...``
Last edited by lighted on Tue Jun 17, 2014 4:11 pm, edited 1 time in total.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 10719 - Quotient Polynomial

Don't read and write to files.
Check input and AC output for thousands of problems on uDebug!

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

### Re: 10719 - Quotient Polynomial

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``````
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman