Page 1 of 1

766 - Sum of powers

Posted: Fri May 19, 2006 7:39 pm
by Observer
Hi,

I'm getting WA for this problem. I'm basically doing polynomial interpolation (Newton form). It seems to work quite well, at least for small cases like k = 5 (I get "12 2 6 5 0 -1 0 0", which I think is correct). And I have learned from Integer Sequences Encyclopedia that my "denominators" (M) are all correct.

Could any one please give me the output for "extreme cases" like k = 0 or k = 20? (I get some pretty larger numbers for k = 20; is this wrong?) Are there any other traps?

Thanks in advance. :)

Posted: Sat May 20, 2006 10:26 am
by little joey
Your output for k=5 is correct, and the output for k=0 is obviously "1 1 0". Giving the output for k=20 would be too much of a spoiler, I think, but the numbers get pretty big: the smallest is -47625039 and the biggest is 44767800.

Posted: Sun May 21, 2006 3:04 pm
by Observer
Thanks little joey. I've got accepted.

My mistake was really that I had the answer for k = 20 wrong. Two of the coefficients I had were clearly wrong. I wonder why I didn't see it... Thanks again!! :wink:

766 P.E. Tried Everything.... Always P.E.

Posted: Wed Jul 04, 2007 7:36 am
by baodog
Hi,

I keep getting P.E. for 766. I follow the output format
exactly and get P.E. I then try 20 different formats with extra
spaces, etc., and still get P.E. What is the correct
format for this problem? Thanks. Here is what my output looks like
when streamed to a file. Note the last line is just EOF, i.e.
a newline after the last ouput and EOF.

Anyway, I would really appreciate some help. Thanks.

Code: Select all

AC


Posted: Wed Jul 04, 2007 11:09 am
by mmonish
>>baodog
Read the output specification.

Code: Select all

Print a blank line between datasets.

This means that there is no blank line after the last output.

Hope this helps.

Posted: Wed Jul 04, 2007 12:03 pm
by Ryan Pai
It looks like you're printing extra spaces at the end of some lines. You probably don't want to do that.

Still getting PE

Posted: Wed Jul 04, 2007 12:07 pm
by baodog
As I indicated, I didn't print a blank line after the last output. There is only a '\n', newline after the last output. I have also tried no newline
at the end, and still get PE. Thanks.

Posted: Wed Jul 04, 2007 12:31 pm
by ayeshapakhi
there's only two specifications...
and these are enough..

Code: Select all

Numbers should be separated by one space.
Print a blank line between datasets.
1st one requires that there'll be no spaces after the last number in a line.

hope these help..

Weird PE Problem

Posted: Wed Jul 04, 2007 12:56 pm
by baodog
Still getting PE!
No Spaces are printed at the end of lines.
Blank Lines between outputs, and no blank line
after the last output. Of course I can read.
No idea why. Maybe the judge's output file got
corrupted recently, or they made some mistake
while changing the output file recently. I bet that if
you got AC before, and if you resubmit, you will get PE.

Re: Weird PE Problem

Posted: Wed Jul 04, 2007 2:01 pm
by little joey
baodog wrote:Of course I can read.
No need to pick at someone who's trying to help you.
Nothing has changed recently, so maybe you should consider the possibility that your program is wrong.

Posted: Wed Jul 04, 2007 8:58 pm
by baodog
I didn't mean to be impolite. I really appreciate your help. Now, I have taken my output for n=0..20, put it in a program as an array of strings, read the numbers back in using streams, and output it again according to the format (blank lines between outputs, one space between each number, nothing else, so simple) ... Still PE.... I apologize for posting this PE code, I will remove it as soon as someone spots the problem.

Code: Select all

AC

Posted: Wed Jul 04, 2007 9:35 pm
by mf
"30 615 10 0 -1 0",
That should be "30 6 15 10 0 -1 0".

problem resolved..

Posted: Wed Jul 04, 2007 9:50 pm
by baodog
Thanks!! Really appreciate it. I had a missing delimiter
in one special case output in the original program....
can't believe I didn't see it ....

Re: 766 - Sum of powers

Posted: Fri Apr 03, 2015 11:01 pm
by alex_gab
Are there any known issues with judge outputs?
I get a "Wrong Answer", though I know my output is correct.

I also want to ask if the below output is correctly formatted?
4

2
6 2 3 1 0

5
12 2 6 5 0 -1 0 0

0
1 1 0

16
510 30 255 680 0 -2380 0 8840 0 -24310 0 44200 0 -46988 0 23800 0 -3617 0

Re: 766 - Sum of powers

Posted: Wed Apr 08, 2015 11:51 pm
by brianfry713
I added critical input at:
http://www.udebug.com/UVa/766