10719 - Quotient Polynomial

All about problems in Volume 107. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

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

Re: 10719 - Quotient Polynomial

Post by sohel »

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

Post 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.
mliu_buet
New poster
Posts: 2
Joined: Sat May 14, 2011 7:01 pm

Re: 10719 - Quotient Polynomial

Post 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
mliu_buet
New poster
Posts: 2
Joined: Sat May 14, 2011 7:01 pm

Re: 10719 - Quotient Polynomial

Post 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

}


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

Why wa? Is it because of IO ?

Post by lighted »

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

Post by brianfry713 »

Don't read and write to files.
Check input and AC output for thousands of problems on uDebug!
lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 10719 - Quotient Polynomial

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

Return to “Volume 107 (10700-10799)”