If you are typing the correct problem number,
then no data structure is needed to solve the problem.
This is a maths problem that can be solved in O(1), search for old post you will find the key to solve.
10512 - A Day in Math-land
Moderator: Board moderators
Reply on 10512
Thank's .. For Your Reply.
Yes That's A Math Problem On Simplify Equation.
But I try Frist And Get WA.
Now I Check All The Prvious Post On It And Try All Input & Output.
But My Answer Is Ok For That's Output.I Can't Understand What's Wrong.
MY Solution Is Integer Solution.
So I Need Help For Some Special Case Or Any Special I/O.
Can You Help Me Please.
THANK's In ADVANCE
Rocky.
Yes That's A Math Problem On Simplify Equation.
But I try Frist And Get WA.
Now I Check All The Prvious Post On It And Try All Input & Output.
But My Answer Is Ok For That's Output.I Can't Understand What's Wrong.
MY Solution Is Integer Solution.
So I Need Help For Some Special Case Or Any Special I/O.
Can You Help Me Please.
THANK's In ADVANCE
Rocky.
About Som Input
What Is The Output For The Following Input
input
2
0 2
0 3
Thank's IN Advance
Rocky
input
2
0 2
0 3
Thank's IN Advance
Rocky
10512 need help
can anyone give some i/o samples?
my program is correct for all the existing samples in the forum, but still get WA...
Thanks
my program is correct for all the existing samples in the forum, but still get WA...
Thanks
Re: 10512 - A Day in Math-land
Nice problem!! Although I must say that I undrestimated the problem at first sight
. A very well-designed and sophisticated judge data, great job Shahriar Manzoor. I got AC with long long int, I think double/long double would also work fine as many others claimed to get AC with these, but I would certainly recommend long long int.
Don't use int because my program got the verdict Wrong Answer with int. Also make sure you are printing a '.' after Impossible
Possible reasons why your program might get a Wrong Answer:
1. Your algorithm is incorrect.
2. Your algorithm can't handle cases like 0 0, 1 0, 0 8, -1 0, -5 -7, etc
3. I got wrong answer twice because of this silly mistake. The problem clearly says if there are multiple solutions of x and y, then print the set of solutions with the lowest value of x(I actually ignored this statement as Im very impatient
). Now consider the case 2 0. What should be the output here? My AC code, gives -1 -1. But notice that 1 1 is also another possible solution, but here as -1 is < 1 we have to print the former set of values.
Now finally some I/O which I generated after solving this problem. Hope I can help you
Thanks.
Lol if you still get Wrong Answer after matching all of the above I/O and you have considered that you need to print the set with lowest value of x if multiple solutions exist, then no one can help you
.
![:x](./images/smilies/icon_mad.gif)
Don't use int because my program got the verdict Wrong Answer with int. Also make sure you are printing a '.' after Impossible
Possible reasons why your program might get a Wrong Answer:
1. Your algorithm is incorrect.
2. Your algorithm can't handle cases like 0 0, 1 0, 0 8, -1 0, -5 -7, etc
3. I got wrong answer twice because of this silly mistake. The problem clearly says if there are multiple solutions of x and y, then print the set of solutions with the lowest value of x(I actually ignored this statement as Im very impatient
![:wink:](./images/smilies/icon_wink.gif)
Now finally some I/O which I generated after solving this problem. Hope I can help you
![:)](./images/smilies/icon_smile.gif)
Code: Select all
40
8 12
12 8
4 6
0 0
0 1
0 2
0 8
0 64
0 32
0 31
0 20
2 0
1024 0
65536 0
729 0
5 3
-4 -6
-2 -12
8 -12
0 -1
-16 0
16 24
24 16
512 0
0 512
26250 -3125
20902684 1580181
1006826600 48139500
7950 4268
12343210 3702963
-1381662 11479312
1250075001 -25000
1539187879 149758950
2112313210 37032963
2185144815 -35798642
2185144814 -35798642
1006826601 48139500
1006826600 48139501
1006826600 48139500
2147294608 33311922
Code: Select all
Case 1:
2 -4
Case 2:
4 2
Case 3:
3 1
Case 4:
0 0
Case 5:
1 0
Case 6:
1 -1
Case 7:
2 -2
Case 8:
8 0
Case 9:
4 -4
Case 10:
Impossible.
Case 11:
Impossible.
Case 12:
-1 -1
Case 13:
0 -32
Case 14:
0 -256
Case 15:
0 -27
Case 16:
Impossible.
Case 17:
Impossible.
Case 18:
Impossible.
Case 19:
Impossible.
Case 20:
Impossible.
Case 21:
Impossible.
Case 22:
6 2
Case 23:
2 -6
Case 24:
-16 -16
Case 25:
16 -16
Case 26:
-25 -150
Case 27:
3567 3124
Case 28:
23950 21940
Case 29:
97 53
Case 30:
3333 2222
Case 31:
3133 -531
Case 32:
-25000 -25001
Case 33:
31350 26573
Case 34:
33333 32222
Case 35:
-32222 -33333
Case 36:
Impossible.
Case 37:
Impossible.
Case 38:
Impossible.
Case 39:
23950 21940
Case 40:
33513 32519
![:wink:](./images/smilies/icon_wink.gif)
![:wink:](./images/smilies/icon_wink.gif)
You tried your best and you failed miserably. The lesson is 'never try'. -Homer Simpson