### Errichto's blog

By Errichto, 18 months ago,

Hi.

On Wednesday at 9:05 CET / 8:05 UCT you can participate in the GYM version of the finals of 2017-2018 Russian Olympiad in Informatics (ROI), Day 1. And on Thursday there will be day 2, same time.

Links to GYM contets: day1 and day2.

5 hours, 4 problems, IOI-style scoring with subtasks. Statements will be available in three languages: English, Russian, Polish.

We wanted to use those problems in a camp in Warsaw so we had to import the problems to some system anyway. Then why not Polygon+Codeforces and thus allowing everybody to participate? Huge thanks to MikeMirzayanov for helping me with using GYM.

And credits to problem authors: Andreikkaa for Radium, Endagorion for Viruses, pashka for Innophone, Георгий Корнеев and GlebsHP for Quantum Teleportation.

Second day authors: _kun_ for Decryption, "jury" for Quick Sort, GlebsHP for Robomarathon, Endagorion for Addition without carry.

I will post a very short editorial in English here, after the contest.

Innophone
Quantum teleportation
Viruses

Second day tomorrow, same time.

Thank you for participation.

Decryption
Quick sort
Robomarathon

• +382

 » 18 months ago, # |   +25 Wow, thank you very much! So you had translated those problems for the camp?
•  » » 18 months ago, # ^ |   +39 I translated from Russian to English, and then a few other guys did from English to Polish.
•  » » » 18 months ago, # ^ |   +34 So, do you know Russian or just used google translate? If you know Russian, it looks like you would be eligible to participate in old versions of vk cup :) (But they may change rules)
•  » » » » 18 months ago, # ^ |   +6 So let's hope they raise the age limit.
•  » » » » 18 months ago, # ^ |   +16 I tried that in the first (I think) version of VK Cup, I was told "nope".
 » 18 months ago, # |   +8 5hours and 4problems!How hard the problem could be...
•  » » 18 months ago, # ^ |   +14 I remember that ROI's difficult as same as Div1B — Div1E (4 problems) if need to solve all subtasks per problem. Something like this
 » 18 months ago, # |   0 Can I ask why it is just a gym? Why didn't you do something like Codeforces Round #545 (Div. 2), some rating round?
•  » » 18 months ago, # ^ |   +30 Probably because there are some people who already know the problems and their solutions
•  » » 18 months ago, # ^ |   +20 The best preparation for an olympiad are problems from olympiads. Similar topics, same scoring format (subtasks). And people solve problems from CF anyway, like Junakson said.
 » 18 months ago, # |   0 Small mistake in Russian name of the contest
•  » » 18 months ago, # ^ |   0 :D Sorry, the Russian name doesn't appear at all in the English interface of editing the contest. It's ok now. (The name was "Russian name".)
 » 18 months ago, # | ← Rev. 2 →   -8 Nowadays cf rounds are happening consecutively .
 » 18 months ago, # |   +18 Day 1 starts in 10 minutes. Good luck!
 » 18 months ago, # |   0 Can you extend registration?
•  » » 18 months ago, # ^ |   0 You can register at any moment of the contest.
 » 18 months ago, # |   0 Can we get the actual verdict?
•  » » 18 months ago, # ^ |   0 I can change if for tomorrow to "complete" feedback whatever that means (does it show a test for which a solution fails?). Also, maybe it would be better to show the current leaderboard? I'm not sure.
•  » » » 18 months ago, # ^ |   0 I think the leaderboard should stay hidden. But that verdicts are really annoying — I don't know if it's TLE or WA. Anyway, it's not a strict problem.
•  » » » » 18 months ago, # ^ |   +9 Not showing TLE/WA on big subgroups is feature intended by problemsetters of original contest, not a bug. When you can submit without restrictions and penalties, many participants starts staring to submit a lot of different trashy hacks, instead of solving problems. So, showing detailed reports on small subtasks, and binary report got score/not got score on big gives you quite a lot of information (most wa's will happen on small subtasks), while not inspiring incorrect and unproven hacks like "oh, lets check first 1000 possibilities, not all". Side effect of this solution, is increasing cost of some kinds of errors like integer overflows or out of bounds, but we consider it reasonable. Anyway, if you are testing large timelimit, you probably should generate big test locally, and will see if it crashes or returning negative answers. If you do not, and just submitting random constants for testing — that is not behavior I want to inspire. Hardness of such tests is one more think which considered when desiding which result showing should be used. Everything above should be threat as my personal opinion, not a official position of Olympiad jury. But I think reasoning of others are more or less same.
•  » » » » » 18 months ago, # ^ |   0 As I said before, that's not a big deal. The only think made me to ask this question was IOI rules thing.And thanks for a detailed answer. I agree with your opinions.
•  » » » 18 months ago, # ^ |   0 Not showing proper verdict costed me not-getting-a-AC.
•  » » » » 18 months ago, # ^ |   +28 Someone can also say "not showing the editorial before a contest costed be not-getting-AC" ;pBut yeah, it's better to show the verdict if IOI does it.
 » 18 months ago, # |   0 I solved B with $O(N \sqrt{N})$ Time, but it turns out to be not enough for getting 100 pts (I submitted with various constants, but 84 was maximum)..
•  » » 18 months ago, # ^ |   0 Sounds like a big constant factor. Organizers' solution: https://ideone.com/12D1zF.
 » 18 months ago, # | ← Rev. 4 →   +8 In the problems 3, how can we prove that it is always optimal to jump to some nodes(i,j) from the node(x,y) that satisfied x<=i and y<=j, which means we don't have to concern about jumping to a node (i,j) where either i
•  » » 18 months ago, # ^ |   0 It isn't true. You must consider all four directions (plus going to the next/previous cell in the same row/column). The lemma is: if you go from $(i, j)$ to $(i2, j2)$ such that $i < i2$ and $j < j2$, then it's enough to consider going to the closest such $(i2, j2)$ (to one of those tied at the minimum distance).Yeah, problems are nice. Kudos to the organizers of ROI. I will list them tomorrow in the blog, when I have time.
•  » » » 18 months ago, # ^ |   0 If we have multiple processors having the same minimum distant from the current processor, do we only need to link to any one of them, or we have to consider all?
•  » » » » 18 months ago, # ^ |   +6 All. Have you read the editorial in the blog?
•  » » » » » 18 months ago, # ^ | ← Rev. 2 →   0 Yes, but I am kind of confused about the detail of the L-shape thing. Could you please explain a bit more?My questions: why is it an L-shape? for finding these processors have the same shortest distant I think it should be a diagonal or so. what do we store and how do we find the vertices in L-shape? Thanks a lot!
•  » » » » » » 18 months ago, # ^ |   0 There is a drawing in the editorial. Each cell in the L-shape has the same distance to the current cell $(i, j)$.If you want to find cells in such a shape, you can use sets of positions for each row and for each column. Or just iterate linearly over all $k$ cells and check which are in the shape.
•  » » » » » » » 18 months ago, # ^ |   0 Oh I see, I made a mistake. I transferred Chebyshev distance to Manhattan Distance, And all I am thinking is with Manhattan Distance. Sorry for that.Got it, thanks!
•  » » » 18 months ago, # ^ |   +11 Oh, I see! I apologize for my misunderstanding. Btw this greedy is very genius and amazing...（easy to understand but super difficult to come up with during the contest）
 » 18 months ago, # |   0 Problem B is quite similar to 436F
 » 18 months ago, # |   +16 Day 2 starts in 10 minutes. This time with complete feedback.
 » 18 months ago, # |   0 Will the standings of Day 2 be available?
 » 18 months ago, # |   +20 When will the tutorial for second day be published?
•  » » 18 months ago, # ^ |   +8 Three of the four problems are done. Robomarathon coming soon. Sorry for the delay.
•  » » » 17 months ago, # ^ | ← Rev. 2 →   +13 Just as a reminder if you have forgotten to add it, but I would like to see the solution to the problem "Robomarathon". I don't intend to hurry you, but I would be grateful if you add some brief editorial about this.
•  » » » » 17 months ago, # ^ | ← Rev. 2 →   +11 Or does anyone know the solution? It seems it was a bit relatively easy one in this problem set, but I haven't got to the right answer even though it has passed 3 weeks after the contest ended. I've been distressed by this problem from morning till night for more than a half the month (note: contains some exaggerations). I guess many participants have already forgotten how to solve this problem, but would anyone help me get out of this restive circumstance?
•  » » » » » 16 months ago, # ^ |   +20 For minimum place, only one start neer this robot should be used. For maximum — either everything with distance not less than closest endpoint (1 or n), or only other endpoint (could be proven by removing closest or adding furthest on other cases).After that number of persons before us is some sets on (i, a_i) plane, number of points in which can be found using several sweeping lines. Also, timelimit in this problem is quite tigh, so good constant is required for 100-point solution. Any nlogn should score 70+.
•  » » » » » » 16 months ago, # ^ | ← Rev. 2 →   0 Even $O(n^2)$ solution can score 78-points or even 83-points if we optimize a lot :-)
•  » » » » » 16 months ago, # ^ |   +22 I've just written a full editorial. Sorry for the delay.It's bizarre that Pavel answered while I was writing it. After two months of you waiting...Sorry again.
•  » » » » » » 16 months ago, # ^ |   0 Thanks for all who taught me the solution! I really appreciate it.
•  » » » » » » 16 months ago, # ^ |   0 I mentioned post in top (probably, because of your edits), and answered for unseen post. Even didn't saw it was 2 months ago :)
 » 18 months ago, # | ← Rev. 4 →   -10 Can someone please tell me why this approach doesn't work for B — Decryption of ROI Day 2: Start from the first element in the sequence not already put in a segment, create a new segment and put every subsequent element such that it's larger or equal to the first element in this segment, and the maximum of all of the remaining numbers is greater or equal to the current maximum element. Here's my code:#include using namespace std; typedef long long ll; const int MAX_N = 10000010; char maxCnt[MAX_N] = {0}; int main(){ ios::sync_with_stdio(false); int n; cin>>n; vector a(n); vector maxValTo(n); for(int i = 0;i < n;++i) { cin>>a[i]; } maxValTo[n-1] = a[n-1]; for(int i = n-2;i >= 0;--i) { maxValTo[i] = max(maxValTo[i+1], a[i]); } int pos = 0; int res = 0; while(pos < n) { int minVal = a[pos]; int maxVal = a[pos]; int s = pos+1; while(s < n) { if(a[s] < minVal) { break; } if(maxValTo[s] >= maxVal) { maxVal = max(maxVal, a[s]); } else { break; } s++; } pos = s; res++; } cout<
 » 14 months ago, # |   0 Hi Errichto, thank you for the great problem set! It seems that subtasks in Day1 P4 are not well configured. My full solution with assert(n <= 50) gets only 33 points. Could you please check this?
•  » » 14 months ago, # ^ |   +10 You should thank the original organizers, obviously :DEverything is ok with subtasks. Notice the dependencies. Subtask 4 requires subtask 2 to be solved so you need to solve $p = 1$ for all $n$ first. This is indeed quite strange but I've just checked in the original Russian statement that it should be like that.
•  » » » 14 months ago, # ^ |   0 That's a weird dependency :p Thanks anyway.
 » 8 months ago, # |   0 for the question Viruses, any idea why this passes. It seems to me like clear $n^4$