|
|
Show all threads Hide all threads Show all messages Hide all messages | How do you solve this problem? | Alex Tolstov (Vologda STU) | 1670. Asterisk | 23 Jul 2020 04:12 | 2 | Let's construct the resulting sequence from N to 1 by keeping merged segments in stack. What is the condition for merging two segments? They are touching by one of the sides (r_1+1=l_2 or r_2+1=l_1). The last part of the solution is trivial (make a tree of merges, ...). | Nice problem | Alexander Kouprin | 1670. Asterisk | 1 Oct 2010 01:37 | 1 | | WA7 | pperm | 1670. Asterisk | 15 Jan 2009 15:08 | 3 | WA7 pperm 14 Jan 2009 16:34 Give me plz some tests. Please only good permutation :) 4 1 4 2 3 This test help me) (1, (2,3) * (4)) = (1,4,2,3) Wa 7 again :) 9 3 2 1 7 9 8 4 5 6 ((1)*(2)*(3),(4,5,6)*(7,(8)*(9))) | question about a specific test | momo | 1670. Asterisk | 14 Jan 2009 16:32 | 2 | For this input: 3 1 2 3 Is this output correct: (1,(2,3)) Why not? I think that it's correct. | Invalid sequence in the example | Bruce Merry | 1670. Asterisk | 10 Jan 2009 15:50 | 2 | As an example of evaluating subexpression, (1, (2 * 3), 4) is shown. However, this is not a valid expression according to the grammar (* can only operate on sequences, not numbers). Which is correct? | What do you mean by "..." in formal definition? | Ilya Porublyov | 1670. Asterisk | 10 Jan 2009 13:08 | 1 | What do you mean by "..." in formal definition? Is it the same as <expression> ::= <sequence>{*<sequence>} and <sequence> ::= (<sequence element>{,<sequence element>} or smth else? |
|
|
|