# | User | Rating |
---|---|---|
1 | tourist | 3690 |
2 | jiangly | 3647 |
3 | Benq | 3581 |
4 | orzdevinwang | 3570 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | Radewoosh | 3509 |
8 | ecnerwala | 3486 |
9 | jqdai0815 | 3474 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 173 |
2 | awoo | 164 |
3 | adamant | 163 |
4 | TheScrasse | 160 |
5 | nor | 157 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 152 |
8 | Petr | 146 |
8 | orz | 146 |
10 | pajenegod | 145 |
+21
uwu it was fun in moscow, hope we will meet again in the future :) |
+28
I considered the input two values at a time. If there are an odd number of integers in initial input we can ignore the last one, because that generates Consider a typical parens-matching problem, where you might consider the "depth" of the parens sequence. A open parens There is a case where having $$$b$$$ The last case to consider is that of valid sequences concatenated together, e.g. So the idea is to keep a stack. For each pair of values in the input, take note of the level we end on ($$$cur+a-b$$$). Pop any levels off the stack that are higher than this — once we go down past a level, we can no longer concatenate to create another valid sequence. If the value on the stack is equal to the current level, this means we have a valid sequence to concatenate onto, and we can add it to our total. There are a few more little edge cases and extra details, but otherwise I hope this gives a good overview of the general idea. See my solution for reference: 127381648. It's actually quite short for such an annoying problem. |
+51
It's really sad that I won't be able to meet up my teammates this summer (nooo Monogon). I took the last week of my internship off to attend this competition, so it's a little frustrating that this notice comes so late, when I'm unable to make many changes to my schedule. Luckily I managed to get credit back for my flights, but I know there are many others who weren't as lucky. |
Name |
---|