11934  Magic Formula
Moderator: Board moderators
11934  Magic Formula
what's wrong with this problem?? f (n) = a x 2 + b x + c .... here what should I think?? Is it b*x or 'x' is here for multiplication.If so....where is other variable?? Again..... test cases are also confusing. 3rd and 4th test case are same but answer is different. Plz...help. I got WA. I didn't participate in the contest. So i don't know if there was a clarification.
Re: 11934  Magic Formula
Yes.. the description is confusing..
The formula is
f(x) = a*x*x + b*x + c
The sample out is also wrong..
The formula is
f(x) = a*x*x + b*x + c
The sample out is also wrong..
Re: 11934  Magic Formula
I think you can solve this problem using simple brute force.receme wrote:what's wrong with this problem?? f (n) = a x 2 + b x + c .... here what should I think?? Is it b*x or 'x' is here for multiplication.If so....where is other variable?? Again..... test cases are also confusing. 3rd and 4th test case are same but answer is different. Plz...help. I got WA. I didn't participate in the contest. So i don't know if there was a clarification.
the format is correct post above...
happy coding~

 Learning poster
 Posts: 62
 Joined: Sat Nov 21, 2009 10:17 pm
 Location: CUET,Chittagong,Bangladesh
Re: 11934  Magic Formula
It is quite ridiculous to have wrong sample i/o......
If you have determination, you can do anything you want....
11934  Magic Formula
The function would be.. f(n) = an² + bn + c
Sample Input
0 0 10 5 100
0 0 10 6 100
1 2 3 4 5
1 2 3 3 5
0 0 0 0 0
Sample Output
101
0
0
4
3rd and 4th testcase are not the same...
i Quit for a fresher start
Re: 11934  Magic Formula
I got Wrong Answer on my first attempt. I got AC after I changed my int variables to long long and I used the fmod function instead of the '%' operator. Don't know for which one it got AC.
You tried your best and you failed miserably. The lesson is 'never try'. Homer Simpson
Re: 11934  Magic Formula
Maybe this was true back in 2011 but the sample input's correct now (in 2014).naseef_07cuet wrote:It is quite ridiculous to have wrong sample i/o......
Also, no such "black magic" going on. ints should be sufficient since the maximum and minimum ranges for f(x) are within 1,000,000,000.plamplam wrote:I got Wrong Answer on my first attempt. I got AC after I changed my int variables to long long and I used the fmod function instead of the '%' operator. Don't know for which one it got AC.
That being said, here's some input / output I found useful during testing / debugging.
Input:
Code: Select all
999 999 999 9 999
283 431 744 2 433
11 65 77 11 389
999 999 999 1000000 987
0 0 0 0 0
Code: Select all
1000
434
36
0