ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1042. Central Heating

How to choose from answers the shortest one?
Posted by Aram Shatakhtsyan 2 Nov 2008 16:05
This problem can be solved by equations, for example
we make equations for the input:

3
1 2 -1
1 2 3 -1
3 -1

whe construct the matrix

1 1 0 = 1
1 1 0 = 1
0 1 1 = 1

since 1st and 2nd equations are the same, it means that
you are free to choose the value for the 3rd variable,
but in fact if you choose its value arbitrarily,
answer length can be changed, two possible answers
are 1,2 and 3, but only 3 is the right answer, because
it's the shortest. What to do with that?
Re: How to choose from answers the shortest one?
Posted by Phan Hoài Nam (HUFLIT) 30 Sep 2010 17:52
this test is incorrect, because 1 combine 3 = 2