Comments
+18

Hi, have you already managed to find out how to make big tests?

On ShashwatS1HELP Maximum Subtree, 7 years ago
0

http://hsin.hr/coci/archive/2015_2016/contest4_tasks.pdf

Problem "GALAKSIJA" has the same idea in it.

On shah_entranceString Concatenation, 7 years ago
0

Let's prove there are always only two prefixes required if it's possible. Let's say we get the answer with more than two strings: $$$s_1, s_2, ..., s_k$$$. Then we can get a string $$$s_1 + s_2 + ... + s_{k - 1}$$$ using only one prefix.

So all we have to do is to find the suffix, such that it is a prefix either. You can do it using Z-function

UPD: I'm quite stupid I guess

I guess ios_base with cin.tie would be enough

On techocup site, where you have registered for this olympiad

0

There are some facts I can't prove because of my bad Englsh)) They are not very hard, but I can try to write proofs for them in Russian if you would want)

It's enough. If we can put a point in ai + 1 and ai - 1, the result will be the same. So I can be wrong in a situation when we can put a point in ai - 1 but can't in ai + 1. Let's take a look at this. The points must be like ...ai - 1, ai, ai + 1(because we can't make a point at here)... Let's increase i until we find a free ai + 1. What do we get? A sequence of adjacent points. I want to say that the result will be the same if we put a point in the left of this sequence or in the right.

If we don't find this i, it means there is a sequence with the end at M. in that case I say that the result will be the same if we put a point in the left or don't put at all.

No, I meant another thing. It's correct that making a point in a_i-1 and a_i+1 would give the same result. But sometimes it's impossible to put a point in a_i+1(like if there are points with coordinates x and x+1)

hmm

Am I wrong in the situaton when there are two adjacent points?

I didn't think about it because my solution had AC

In B that's enough to check a_i + 1 only