Hi everyone!
I gave a contest in winter Petrozavodsk programming camp and now I'd like to share it with codeforces by making it a contest in codeforces gym: 2018-2019 Winter Petrozavodsk Camp, Oleksandr Kulkov Contest 1. It was my first experience giving a contest to the camp and I'm pretty much excited about it!
In the camp only 7 out of 11 problems were solved, so there should be something in the contest for everyone. To make the contest more interesting I suggest you to participate in it as live contest on Saturday, 9 March, 12:00 (UTC+3), which may be changed in case of overlap with some other contest or if it's inconvenient for many participants. After this I suggest to gather here and discuss problems (if anyone's going to participate, of course). I will also post editorial which may (or may not) contain some neat stuff.
Uhm, good luck and have fun :)
P.S. It appears you already may see problems if you have coach mode enabled, I'd ask you to not do this unless you're not going to participate in contest!
UPD: Gentle reminder that it's less than 24 hours before the contest and it's hopefully not going to be rescheduled this time.
UPD 2: Thanks everyone for participating in the contest! Here are editorials: link
UPD 3: Google drive link got broken, so I uploaded the editorial to the contest directly.







as
.
if I'm not mistaken. Can anybody suggest any faster algorithm?


and multiplying it with
. Enjoy your power sums without Stirling and/or Bernoulli numbers!
.
correspond to segment
and the path from
) will be
subsegment which gives you the opportunity to process queries on pathes and subtrees simultaneously in the same segment tree.
?
? Can you prove it or make a counter-example?
online (ie, answer will be received for each prefix).
offline. The first algorithm with such an assessment was offered by David Eppstein in 1992, reducing it to fully dynamic minimum spanning tree problem, but here we will focus on a simple algorithm, proposed in 2012 by Sergei 