Hello!

ACM-ICPC Southern Subregional Contest (NEERC/Northern Eurasia) 2017 has ended on October 18. There were 73 teams onsite in Saratov, most of them were invited because of their result on the qualification stage.

On Saturday, October 21, 08:05 (UTC) will start online-mirror 2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred).

I invite ACM-ICPC teams and individual participants of Codeforces competitions to take part! Sure, the contest will be unrated.

Great opportunity for preparation

Is it rated?

It is not rated.

Is it rated?

surely won't.

Will it be more Div1 or Div2 oriented? Asking this because last NEERC round was of Div2 difficulty.

It will be interesting for both divisions.

One computer for one team?

Preferred, I guess.

ACM-ICPC Rules,

Is it similar to normal codeforces competition for submission or different. In following terms -

Are you going to post editorial?

In C, I fixed the number of times I used the first package, and based on that calculated the minimum number of times I need to use the second package to satisfy the time constraint.

I got a lot of WAs on test 80 using this. But then I added a single line to swap the two packages if t2 < t1 and got AC.

I am unable to prove why always fixing the cheaper package is correct. Can someone please explain?

Also, how to solve B?

Hm, I came up with exactly the same colution and had WA89. After you suggestion I swaped packages if t2 < t1 and got AC in practice too...

Basically in the optimal solution it's possible that you won't be using some package fully, because you will have already downloaded the file. Thus it's better to choose the slower of the 2 package types as the one you won't be using completely, that's why you need to swap or just do one swap in the beginning.

Oh, right. I think I got it. Thanks!

B: If graph has a cycle, answer is obviously -1. Otherwise, compute maximum possible for each vertex. Sort all vertices by that values. Go from smallest to largest, greedily select the minimum values which doesn't present yet.

Where can we find the onsite results?

link to results

How to solve J? Was it greedy?

We will always demolish a building as late as possible.

For each building, find the highest month such that money for that month >= renovation cost of this building.

Then go in inc order of months and destroy buildings greedily, i.e choose to destroy a building if it costs less than the money you have currently. Additionally, you may choose to "undestroy" a previously destroyed building in favour of a new cheaper building.

See code for details.

Code

Bitset works much better than FFT!

bitset works much better than fftrank 1FFT works better than bitsetrank 20lol

It turns out that we are right lol.

When will the test cases be visible?

Why access to the solutions is restricted?

How to solve G and K?

G:

For min:

Start from dfs from

s. In the dfs (let the current vertex beu) if there is an adjacent undirected edge tovdirect it likeu<-v. Run dfs from the adjacent vertices.For max:

Start from dfs from

s. In the dfs (let the current vertex beu) if there is an adjacent undirected edge tovdirect it likeu->v. Run dfs from the adjacent vertices.Code

Sorry for the stupid question but how do you get the intuition that this greedy is optimal?

For maximum:

If we are in

uand there is an unirected edge tov, there are two options:We go through this edge and we visit vertex

v(we direct it likeu->v). This way we will increase our dfs tree.The other option is to direct the edge like

u<-v. This way we will use this edge, only if we go tovfrom another path, and then visitu, but this won't increase the answer, as we have already visitedu.From here we conclude that it's always best to direct edges like

u->v.For minimum:

If we are in

uand there is an unirected edge tov, there are again two options:We go through this edge and we visit vertex

v(we direct it likeu->v). This way we will increase our dfs tree. Well we don't want to increase it.The other option is again to direct it like

u<-v. Well this is optimal because this way we will actually reach only the vertices, reachable fromsusing the already directed edges.From here we conclude that it's always best to direct edges like

u<-v.Thank you. Do you also know the solution for K?

it seems G is also solved by greedy algorithm. loop from left to right and then from right to left to make "s[i]<=s[pre]+1" sufficient. searching for explanations... 31557013

K:

x[0] =s[0] +g[0]x[i] =min(x[i- 1] + 1,s[i] +g[i]),i= 1..n- 1y[n- 1] =s[n- 1] +g[n- 1]y[i] =min(y[i+ 1] + 1,s[i] +g[i]),i=n- 2..0s'[i] =min(x[i],y[i])If

s[i] ≤s'[i] ≤s[i] +g[i] for alli, then otherwise — - 1Why is this correct?

I proved it by submitting and getting AC :)

Actually we should find extremum(for minimum) points and simply make stairs between them. It looks like this:

`./\./\./\./\.`

Is there any editorial available for this contest?

follow

For question E i first took all the possible strings (indices) and then run a loop from 'a 'to 'z' including character only if it is not visited(not unfolded) and frequency of this character in all possible strings is equal to number of strings which means that it is occurring in every possible candidate of hidden string. Hence this character can be counted. But i could not use any data structure efficiently for this. Can someone please suggest some better one !!Thanks in advance :)

For problem number H. When I want to copy case number 7 why it copied

45 f3409ufEFU1BQZKqdp2CV3QV5nUEsqSg1ygegLmqRygj

? :(

I'm so stupid in the match time.I had wanted to rush A but I wrote an 'I' to 'l',then I was wrong for 3 times!I'm so sad and it's not a good day!

what is the idea of problem I ? and are there many ways to implement it ?

It is pretty obvious that the array should be sorted first and then each partition will be a subarray of this sorted array. We do a binary search on the answer

ans. To do so, we need to know whether we can divide the array such that each partition has size atleastkand the difference of each partition can be at mostans.We can solve this by dp. Let

dp[i] be 1 if we can partitiona[1...i] according to the stated condition. Now, consider the partition theith element is in. The previous partition can end in at most thei-kth index. Also, consider the last element which is less thana[i] -ans. The current partition must start after that element. So, if any of the dp values within this range is 1, then we can setdp[i] = 1, otherwise it is zero. So, we need to check whether any of the dp values within a range is 1. We can easily do so by keeping a BIT on the dp values.Instead of a BIT, you can also just keep a pointer. Here is my solution — http://codeforces.com/contest/883/submission/31580263

Now that you say it, we don't need bit, because we are doing no extra updates, we are updating each value exactly once, so a prefix sum array works just fine.

can you please look at my code once, i have tried the same approach as you told but it gave me WA at test 64 !

code : http://codeforces.com/contest/883/submission/31633125

In question I after fixing the answer how to check wether this answer is possible or not?

I really enjoyed this one :) thanks you ^^

Why is it that solved problems in this contest do not appear as solved in the UI (that is with green coloring)? Every other contest is fine for me I think.

Perhaps it may be because it is team contest.

I soloed the contest and only 2 of my solved problems are marked with green. It's probably a bug.

In my case I cannot see the problems I have solved in that contest, everything is just colored as white.

How to solve B,my solution got WA and can not deal with all the situation TnT

Hi, in Problem H, for the test "20 qqqoqqoqMoqMMMqqMMqM", my program outputs "4 MMMMM oqoqo qqMqq qqMqq ", and the result is "wrong answer Incorrect cut". I don't know why it is incorrect cut? Can anyone explain this?

Your program outputs "4 MMMMM MoooM qqoqq qqoqq" Which as you can see, reduces q count by 2, and increases o count by 2

I see, thanks.

How to solve D and L?

http://codeforces.com/contest/877/problem/C link does not working . Why?

Submission

How isn't "qqqqoqqqq" valid?!

You need to have as more palindroms as possible

`determine the minimum number of palindromes of equal lengths to cut s into`

ah, sorry, i read solution wrong

your submission is wrong because you don't use all characters from given string

My commented solution for problem H.

106432651