1200 - A DP Problem
Moderator: Board moderators
1200 - A DP Problem
I can't exactly understand when the solution will be IDENTITY and when it will be IMPOSSIBLE........
Can anyone help???
Can anyone help???
Re: UVA 1200 clarification
All right , I've understood what's the difference.
Re: UVA 1200 clarification
If getting WA and don't understand what wrong... then pay attention to line
So, for negative number... you know what to do...!If s is the solution to the equation, the output line should contain s (the ``floor" of s, i.e., the largest integer number less than or equal to s).
Re: UVA 1200 clarification
Some test cases:
input:
Output:
input:
Code: Select all
10
0x=0
3x=-9
4=4
2+0x=3+0x
2x+3=0
7x-100=2x+200
x-3=3-x
-x-x-x-x=4
-x+x=2
-x+x=0
Code: Select all
IDENTITY
-3
IDENTITY
IMPOSSIBLE
-2
60
6
-1
IMPOSSIBLE
IDENTITY
-
- New poster
- Posts: 3
- Joined: Fri Sep 14, 2012 1:13 pm
Re: UVA 1200 clarification
I don't see how he got 6 with this???
Is there any other test case? I have tried my code with so many test cases and found nothing wrong yet. Is there any suggestion? Thanks.
Code: Select all
x-3=3-x
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: UVA 1200 clarification
That should obviously be 3.
Check input and AC output for thousands of problems on uDebug!
-
- Experienced poster
- Posts: 122
- Joined: Tue Apr 16, 2002 10:07 am
Re: UVA 1200 clarification
Following the statement from the problem description:magurmach wrote:Some test cases:
input:Output:Code: Select all
10 0x=0 3x=-9 4=4 2+0x=3+0x 2x+3=0 7x-100=2x+200 x-3=3-x -x-x-x-x=4 -x+x=2 -x+x=0
Code: Select all
IDENTITY -3 IDENTITY IMPOSSIBLE -2 60 6 -1 IMPOSSIBLE IDENTITY
Are these data correct?No unary plus or minus operators are allowed in the expressions.
Code: Select all
3x=-9
-x-x-x-x=4
-x+x=2
-x+x=0
-
- Experienced poster
- Posts: 122
- Joined: Tue Apr 16, 2002 10:07 am
Re: 1200 - A DP Problem
Be careful to output the *floor* of your result.
Input:
Output:
Input:
Code: Select all
1
2x=0-3
Code: Select all
-2