10719 - Quotient Polynomial
Moderator: Board moderators
Re: 10719 - Quotient Polynomial
Option 3) You can verify whether the test cases you have posted are correct using http://uvatoolkit.com/problemssolve.php
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.
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
@amishera,
You used,
it should have been,
Thanks
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
I think you are tired of the input format:(strtok,sscanf,...bla bla)
lets check this out,
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 ?
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
-
- 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!
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