unbelievable's blog

By unbelievable, history, 4 years ago, translation, In English

Hello everyone. Recently I found interesting problem from UVA online judge.

Short statement. There is an array $$$a$$$ of size $$$n$$$. You are given pairwise product of elements of $$$a$$$ ($$$n \cdot (n-1)/2$$$) products in total). You should find lexicographically minimal array $$$a$$$. $$$n \lt 200$$$.

Does anyone has ideas how to solve such problem?

  • Vote: I like it
  • +37
  • Vote: I do not like it

»
4 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by unbelievable (previous revision, new revision, compare).

»
4 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Gaussian elimination ?

»
4 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

If you know $$$a_1$$$ and $$$a_2$$$ you can restore the whole sequence. You can either try all divisor pairs of the smallest product or try to find $$$a_2 \cdot a_3$$$ pair and deduce $$$a_1, a_2$$$ using it ( https://cses.fi/problemset/task/2414/ )