Page 1 of 1

10756 - HardNumbers

Posted: Fri Nov 12, 2004 7:47 pm
by Krzysztof Duleba
I'm not sure how should I unserstand the operations. What is the right output for the following input?
6

123
123
pxj

123
13
pxj

123
21
pxj

123
31
pxj

123
231
pxj

1
0
pxj
Are there any other special cases that I should handle?

Posted: Mon Nov 15, 2004 3:51 am
by Dyatlov
You should read the input and output description carefully. Everything is said there.

Posted: Mon Nov 15, 2004 4:25 am
by Adrian Kuegel
The output for your test cases is obviously:
123

13

21

31

231

Impossible

But here is a tricky test case:
00
0
j

output should be: 00

Posted: Mon Nov 15, 2004 5:08 pm
by Krzysztof Duleba
Dyatlov - it wasn't clear to me that operations can be joined in any order.

Thank you Adrian for a great case. What about this one:
02001
21
j

Posted: Mon Nov 15, 2004 5:59 pm
by Adrian Kuegel
I guess you wanted to see the answer for this case (the answer for your case is impossible):
02001
21
jx
my output is:
21

Posted: Mon Nov 15, 2004 6:10 pm
by Krzysztof Duleba
No, that's exactly what I wanted to know. I thought that 0, 0, 1 can be joined together into expression equal to 1 and then with 2 into 21 and then with 0. Thanks.

Posted: Mon Nov 15, 2004 8:11 pm
by Krzysztof Duleba
Just got AC. Thanks for your help.