I'm surprised there's no blog post to this... just so nobody misses it:

**Round 3 of Croatian Open Competition in Informatics** takes place at this time today, and lasts 3 hours.

You can log in to the contest site at evaluator.hsin.hr, or register an account there if you don't have one already. Make sure to select the right contest from the list when logging in — it's not HONI, but COCI.

Everything related to the contest should be posted here in a few weeks' time (except the solutions, it seems).

Feel free to discuss the problems here **after** the contest is over.

Isn't KOLINJE solvable in linear?

Yeah, it should be, and easily. I don't know why the constraint on N is so low. Maybe preparing people for FB Hacker Cup and its fake constraints :D

I failed most tests on it, though — because I didn't write

`long long`

instead of`int`

once. Punishing such silly mistakes excessively is the main unfairness of contests without feedback...How to solve 6th problem?

Is the idea of the sixth problem to maintain a set of slopes (convex hull method) to find the nearest covered points to the left and right of each building?

My idea involved keeping a convex hull of a decreasing sequence of buildings seen so far, from which one of those points can be directly extracted. But it should work with a structure for set of slopes as well, since it's not much different.

Test are very simple on KOLINJE!

Anyone know how to you solve 5th problem?

I could wait for the official solutions, but yeah they're a bit slow with them.

Suppose that you're counting the "difference" of 2 numbers,

XandY. How many times will thei-th digit ofXbe equal tox? And how many times will that digit ofYbe equal toy? You can count that (it's actually the same result forXandYifx=y), and from it count how many times will you count |x-y| into the result. Loop that over allx,yandi.How to count how many numbers in the interval [

A,B] havexas thei-th digit? That interval is the difference of [0,B] and [0,A- 1], and so are the answers, so let's just takeA= 0. Well, if the part of the number before thei-th cipher is strictly smaller than inB, we can choose all digits fromi+ 1 to last position to be anything from 0 to 9; it can't be larger, and if it's equal, the part of the number after thei-th position must be ≤ to that inB. Using modular arithmetic, it's not hard to count it using this.Awesome, thanks.

repetition

The full results are up in the system.