Yandex's blog

By Yandex, history, 6 weeks ago, translation, In English

Hello Codeforces!


We are delighted to invite you to participate in Yandex Cup 2024!
Yandex Cup is a championship in six different tracks:

This year, as a pilot project, we are inviting schoolchildren (so far only from Russia) to participate in the Algorithm and Analytics tracks.


The championship consists of three stages.

Schedule

The stages and dates are different for Machine Learning and Mobile Development. More details about the terms and conditions can be found on the track's pages.

REGISTER

Qualification is a contest with a virtual start. You can write a context during the week from 14 to 20 October. The duration depends on the selected track. After the qualification stage we will publish the criteria for the semifinal.

Semifinal will be held on 3 November. The start of the contests is at 12:00 (GMT+3) and at 17:00(GMT+3) at the Algorithm track. Duration depends on the selected track. The top 20 semi-finalists in each track and the top 10 students in the tracks Algorithm and Analytics will qualify for the finals

The final of the competition will be held in Tashkent Uzbekistan on 2-6 December. All expenses related to travel and accommodation of the finalists will be covered by us.

This year, we have also increased the prize fund, which amounts to 12.5 million rubles

See you at the Yandex Cup!

  • Vote: I like it
  • +257
  • Vote: I do not like it

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been translated by Yandex (original revision, translated revision, compare)

»
6 weeks ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Yandex Contest of tourist was fun to watch without understanding anything.

»
6 weeks ago, # |
  Vote: I like it -118 Vote: I do not like it

the prizes are not worth trying

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    activities for non-rich competitive programmers

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

on which website will the contest be held? it will be my first time participating. some help would be appreciated :prayge:

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

It seems that only the Algorithm track is available in English. To what extent will the non-Algorithm tracks use Russian? Would it be manageable (time-efficient) to use Translate to understand and solve problems in other tracks, say ML?

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    ++, i wanna participate in the ML Track but the russian language is bugging me

»
6 weeks ago, # |
  Vote: I like it -18 Vote: I do not like it

These opportunities can also be a great motivation for competitive programming .

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Form page is not opening, showing loading only !

»
6 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

It seems to me that there is no "other" option for university. Nevermind, found it.

»
6 weeks ago, # |
  Vote: I like it +10 Vote: I do not like it

I didn't really understand how many people will qualify to finals

»
6 weeks ago, # |
  Vote: I like it +10 Vote: I do not like it

The time to start qualification round is not properly mentioned. What time it is??

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it -34 Vote: I do not like it

    This century

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    It says it up there. You can start the contest anytime during the week.

    Qualification is a contest with a virtual start. You can write a contest during the week from 14 to 20 October. The duration depends on the selected track. After the qualification stage we will publish the criteria for the semifinal.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Where is the contest link? There is no email or any link in this post also.

»
5 weeks ago, # |
  Vote: I like it +20 Vote: I do not like it

Its 10/14 and contest has not started. Theres even no announcement of when does contest start!

»
5 weeks ago, # |
  Vote: I like it +10 Vote: I do not like it

May I ask how long the window of qualification round would take? It seems I cannot find some useful information related to this... I need to decide when to start once I could know the duration of the window :(

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    It's a 2 hour round.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Duration of Qualification by track: Algorithm — 2 hours Analytics — 5 hours Backend — 4 hours Mobile Development — 3 hours Frontend — 5 hours All contests with virtual start

»
5 weeks ago, # |
  Vote: I like it +25 Vote: I do not like it
  1. Press register.
  2. Requires yandex id or whatever.
  3. Press create.
  4. Requires phone number.

I think I'll pass.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Hello!

    Users located outside of Russia can also sign up using their Facebook, Google or X account.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thanks for the clarification. Thankfully I have several fake facebook accounts that were registered a long time ago so I can use one for this. Please avoid making login system that requires phones\government id verification in the future.

      Appreciate the organization of the contest though, thank you.

    • »
      »
      »
      5 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Hi! It seems that the Yandex Forms page I'm redirected to after creating a Yandex ID also requires a phone number. Is there a way to bypass that too?

      • »
        »
        »
        »
        5 weeks ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        You can just put fake number like +1(111)1111111, it's not validated there.

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Only Russian allowed to get a price?

»
5 weeks ago, # |
  Vote: I like it +13 Vote: I do not like it

What was the last year qualification border(to semifinals)?

»
5 weeks ago, # |
  Vote: I like it +11 Vote: I do not like it

When will the results / cutoffs for Algorithm and Analytical Rounds come out!! :-)

»
5 weeks ago, # |
  Vote: I like it +11 Vote: I do not like it

Is there any reason why a points cutoff and/or number of participants qualifying to a semi-final is not announced beforehand? Is there at least some statistics from the previous years about how many problems was required to advance from qualification to a semi-final in the Algorithm track?

  • »
    »
    5 weeks ago, # ^ |
    Rev. 2   Vote: I like it +4 Vote: I do not like it

    Managed to find criteria in the 2023 post, participants said the border was approximately about 3-4 tasks.

»
4 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

when could us to discuss the tasks of the contest?

I want to know how to solve task F :(

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Very true, i would be grateful if someone can explain F itself. I was not quite sure if I understood the task itself. The only significance of 16 i saw is that log_2 (2024) = is 11 and 11 < 16 due to which i thought of binary search but not quite sure how to proceed at all.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +31 Vote: I do not like it

    Let's discuss the solution to the 15-question problem.

    Note that we ask all our questions before receiving answers! After processing the answers, we should determine if there is an error (in case there is one) and correct it.

    The first part (if we only get correct answers, this is a classic problem):

    • The i-th set contains all numbers whose i-th binary bit is 1.

    • We ask 11 questions and we get a guessed number.

    The second part (the idea is that we will get 15 bits of information and need 11 of them to be correct... [Hamming Code], right? 11 + 4 bits is a well-known basic code):

    • The adjustment of the first part and the Error Correction Code took me about an hour :) One can do it much faster.

    Try it out!

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thank you so so so much. This makes a lot of sense :-)))))

      The idea of hamming codes did strike me in contest but i did not realise the "if we get only correct answers" it is 11 part.

      Now it makes so much more sense. TYSM!!!

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Did anybody solve Backend D?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I didn't solve D completely, only got 14 of 200 points.

    My idea was to store the data on cache servers (hash(key) % n) and ((hash(key)+1) % n). When a key arrives I first check the cache servers. If they have this key, I simply return the data. If the key is not there, I request db, store to the cache servers and return the data. In case one of the cache servers is down, I can always request from the second cache. Also in this way the data is evenly distributed across the caches.

    It was pretty hard to debug, because the stderr output was limited in length. I don't know if this solution satisfies all the conditions: at least it can request the db twice in case the program is stopped at the moment between GET from db and PUT to cache (maybe we had to do something with catching signals?). Besides, the example suggests that the program straightly requests the db when it sees a key for the first time, but if we remember all the keys in memory, it will be cleaned when the program is restarted.

    As far as I could see from the stderr, in the failing test all the keys were present in db, but that case could probably happen too.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I also got 14 points. Have no idea what can be wrong. Did you order somehow cache urls? One of my idea, that after restart order of urls in the config has changed.

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Actually, upsolving is open through the same link in your account.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Got 200 with absolutely same idea.

      I used C#. My mistake was that I forgot native string.GetHashCode() is not stable between runs. As soon as I wrote alternative hash code I got full score.

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        100%! the same holds for Python hash(). I thought that is cool, because there will be no worst case example, but didn't realise of reruns.

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        could you share the code, pls? i also use c# and don't understand why my solution didn't work with io property.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

intended solution for problem C and D of algorithmic track , how the M-N>N was utilized in D and for C is it DP or greedy way also possible ?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    D is quite a nice problem

    The basic idea is that you need to find the value of both M, N. Use the fact that M — N > N --> M > 2N

    So first you output 1, if you get okay then you have found N.

    Otherwise N >= 2 so M > 4 so output 5. (not binary powers i.e, 1 2 4 8 etc works but this is slightly optimised). Then you N >= 6 so M > 12 so try 13 and so on.

    Once you find the "ok" you know the values of m, n, so just binary search to find the answer

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    For C, the question was a bit confusing to me; but after some amount of guessforces and checking if samples worked or not (and WA's :-), this finally worked

    sr[i].second = max(sr[i].second, r); sl[i].first = min(sl[i].first, l); sr[i].first = min(sr[i].first, r); sl[i].second = max(sl[i].second, l);

    repeat this from i = n — 1 to 0 and then print

    max(sr[0].second — sr[0].first, sl[0].second — sl[0].first)

    I hope this was helpful :-)

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      D was really cool now that i got how to utilise that M>2*N thanks, for C do you have a proof of why your algo works ? is it possible to use dp in this ?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    For C you either use only L or only R, so you can try both and take the max. For the proof:

    • First you can realize that if you reach the extreme on the left first then you can use only L at the beginning and then only R after reaching it. Similarly if you reach the extreme on the right first, you only use R at the beginning, and then only L. With this I think you could already use some data structure to solve the problem.

    • If you take an optimal solution. In the first case (first use L then R), if you replace some of the L into an R the maximum distance either doesn't change or increase by 1 or 2, so by doing this you end up with a solution that has only R and is just as good or better.

    • »
      »
      »
      4 weeks ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      nice proof really liked it , would like yandex cup in next years to have the all the tracks in both English and Russian it would be so much better tbh . Btw those who did the analytics track how they did they solve A,D,E ?

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        A. Let $$$F(a, b)$$$ be the probability of placing a thing in the first cave after $$$a$$$ unsuccessful attempts to find it in cave 1 and $$$b$$$ attempts in cave 2.

        $$$F(a, b) = \dfrac{0.65 (1 - 0.44)^a}{0.65 (1 - 0.44)^a + (1-0.65)(1-0.44)^b}.$$$

        So the answer is $$$F(3,7)$$$ and $$$F(2, 0)$$$.

        D. Let $$$\alpha$$$ be the expectation of one move (when all 5 dices are in hand); and $$$p$$$ be the probability to get 0 points at this move. I wrote some python code to calculate it.

        Then it's reasonable to try the next way: find $$$x$$$ such that $$$x > (1-p)x + \alpha$$$, the value which is more likely to get zero points by move than to increase it.

        So, $$$x = \alpha / p$$$. And we have to round it up to the nearest integer divisible by 5.

        E. Find some borders of '1': minimal and maximal row and column:

        • check, that it's a square
        • validate the frame of the square
        • validate diagonals

        P.S. I posted video with some explanations and ideas here (in russian)

»
4 weeks ago, # |
  Vote: I like it +13 Vote: I do not like it

What is the criteria for the Semifinals qualification this year?

»
4 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

Am I the only one, who finds A to be harder than B and C? Maybe, I didn't get the easy idea of the solution, but I needed binary search and use not so easy math), while B and C were pretty trivial.

Also, D is not original, it's almost the same as this task from NCPC

I didn't see anyone asking, but what's the intended solution to E? At the upsolving, I solved it, using dynamic programming, where I kept at each bit hash table, where values were the weights after including some last bits and not including bits that are less or equal to the current, and at the keys I kept the number of ways to achieve that weight in the following way. The only thing, that optimised this approach, was to check, if it's potentially possible to achieve this weight (if multiplication of mask with all 1 bits that are less or equal than the current and the biggest integer from the array a is bigger or equal to the current weight, then we potentially can achieve this weight, otherwise it's impossible). You can actually see my code here. I'm wondering, if my solution is what was intended? I still don't have proof of why this should work fine, so, maybe, someone could provide it?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    I don't know if this is intended, but a trick is this: You try to satisfy the equality $$$\sum w_i 2^i = n$$$ gradually, by first making sure it is true $$$\mod 2$$$, then $$$\mod 4$$$ and so on. When working $$$\mod 2^k$$$ all weights multiplied by a bigger power of two do not matter. This gives rise to the following DP state:

    $$$\text{dp}[k][\text{carry}] = \text{number of ways to satisfy equality} \mod 2^k$$$ $$$\text{and such that the weights } <k \text{ carry over to the bigger bits with this carry.}$$$

    In this DP state you have not decided yet what the weights will be for the bigger powers. Notice that the carry is at most twice the input weights, which is 100, and it does not make sense to add bigger weights than $$$\log_2(n)$$$, and for each DP state, we enumerate what the next weight will be. So this solution can work for much bigger constraints.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      My solution is the same. Here's the code if someone needs it:

      Code
    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      For problem E, I just submitted a brute force and it passed within 10ms...

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think yours is indeed intended. Actually, it would be more intuitive if you start from the $$$0_{th}$$$ bit, and then erase all states where $$$0_{th}$$$ to $$$i_{th}$$$ bits are not equal to $$$0_{th}$$$ to $$$i_{th}$$$ bits of $$$n$$$. There would only be at most $$$100$$$ states in each iteration, since you can at most add $$$100 * 2^i$$$ and $$$0_{th}$$$ to $$$i_{th}$$$ bits are fixed, thus only $$${i+1}_{th}$$$ to $$$i+6_{th}$$$ bits are free.

    Your code actually does similar things, but just in a reverse manner. Just your code fixed $$$i+7_{th}$$$ to $$$26_{th}$$$ bits are $$$0$$$, and only $$${i}_{th}$$$ to $$$i+6_{th}$$$ bits are free.

    Disclaimer: I might be wrong about the exact number of the bits above but I'm too lazy to validate them. Just roughly it could show that its $$$O(log(n) * max(a_i) * m)$$$.

  • »
    »
    4 weeks ago, # ^ |
    Rev. 2   Vote: I like it +2 Vote: I do not like it

    I had a O(nm / 2^B + m^B) solution

    You do a dp for all bits except for the smallest B bits and bruteforce the coefficient of smallest B bits

  • »
    »
    4 weeks ago, # ^ |
    Rev. 4   Vote: I like it +8 Vote: I do not like it

    Problem E: after your setup, you want to receive a $$$k$$$-bit word and uniquely determine the word from your list it differs from in at most one position. So, in particular, every two words in your list must differ at 3+ positions, because otherwise you wouldn't determine the answer for a word that differs from both of them in at most 1 position.

    First of all, since every your codeword generates $$$k+1$$$ possible answers you want to map to it, we have $$$2025(k+1) \le 2^k$$$, so $$$k\ge 15$$$. Second, this construction is called "error-correcting code", I used some linear code that is basically a carefully chosen 11D subspace of $$$\mathbb{Z}_2^{15}$$$, so that every non-zero vector there has at least three ones. I learned such things in my university earlier, but, to my shame, I had to google this during the round.

    Apparently, you also needed to handle receiving -1, because it could happen any time and didn't mean that you did something wrong (???). Would be happy to hear the reason behind this

    UPD: ah sorry, I am talking about the last problem

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    What was the maths in problem A except computing lcms and using inclusion-exclusion principle for 3 numbers?

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes, I got accepted using this principle too, but I find it to be harder than greed approach in C or very trivial trick in B. I find them to be easier from the implementing point either.

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I agree that A is easier than B, C and even D. But in ICPC-style contests we cannot actually rely on the problems being sorted by difficulty (although it would be nice in this case because it's just a qualification round open also to newcomers).

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    If understand it correctly your solution is indeed fast, and I have the same idea but used recursive approach: $$$rec(k, w)$$$ — number of ways to get weight = $$$w$$$ using the first $$$k$$$ bits. The idea is to try to use brute-force from the highest bits and memorize the values that you visited before, and most importantly to exit the recursive call if it is not possible to get required weight. (I sorted array $$$a_i$$$ to make it more convenient). It is not possible to get the weight = $$$w$$$ if $$$w > a_m \cdot (2^{k+1} - 1)$$$. In the worst case, $$$a_m = 100$$$, so if $$$w > 100 \cdot (2^{k+1} - 1)$$$ we can exit the recursion.

    This solution works fast, and can be proven in this way: For the $$$k \leq 18$$$ we can use $$$dp_{k, w}$$$ — number of ways to get the weight = $$$w$$$ using the first $$$k$$$ bits. This dp takes $$$\sum_{k=0}^{18} (2^{k+1} - 1) \cdot 100 \cdot 10 \approx 2^{20} \cdot 1000 \approx 10^9$$$ operations. And the last 8 bits can be calculated by brute-force in $$$m^8 = 10^8$$$ operations.

    On practice this solution works much faster because the brute-force for the last 8 bits has many cutoffs and dp is calculated recursively, which makes solution faster as well. My solution works in 2ms for all tests.

    Also, this problem is very similar to the 2123. Knapsack.

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

In the post it says the semi-finals is one 2nd November, however in the website it says 3rd November. Can you please confirm which is correct?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It has been rescheduled to 3rd November (because 2nd November is a working day in Russia).

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone also discuss the analytics track too ? for A is it bayesian only ?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

How to know whether I qualify? Also how to solve E?

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It will be announced in a few days, probably you will receive an email.

  • »
    »
    4 weeks ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I guess if you solved maybe >=3 or 4 you will qualify

»
4 weeks ago, # |
  Vote: I like it +5 Vote: I do not like it

Yandex Can you add Node.js to Algorithm track next year?

»
4 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

What is wrong with my Algorithm A?

I used binary search with inclusion-exclusion principle, that give the number of good numbers less than $$$mid$$$ is

$$$mid/lcm(a,b) + mid/lcm(b,c) + mid/lcm(c,a) - 3*(mid/lcm(a,b,c))$$$.

But why am I getting WA on 25?

  • »
    »
    4 weeks ago, # ^ |
    Rev. 3   Vote: I like it -10 Vote: I do not like it

    When all three numbers are different, this is the correct approach (at least, I was able to pass test 25 although didn't AC the whole problem).

    You need special cases for a=b=c and when 2 out of 3 numbers are equal (and in the latter case you need to take into account the case when one of these 2 equal numbers divides the third one or vice versa).

    But still, despite all this handling of different cases I got WA 64 and would be interested to learn what's wrong with my solution.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Description looks correct. Can you share the code?

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      My code
      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        You can return 10^18 + 5 as an answer instead of -1 based on instructions.

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        One more thing is that there can be overflow during lcm(aa, bb).

»
4 weeks ago, # |
  Vote: I like it +3 Vote: I do not like it

where can I see the standing of algorithm round?

»
4 weeks ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

According to the telegram channel of Yandex Cup, everyone, who receives at least 3 points, advances to the semi-final. Also there are open standings now, and not only for algorithm track (for backend also, idk for other tracks).

(I'm talking about the algorithm track, for backend track you needed to receive at least 160 points).

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    So score cutoffs are:

    • Frontend — 26
    • Analytics — 31
    • Backend — 160
    • Algorithm — 3
    • iOS — 13
    • Android — 12

    This year Yandex employees were also allowed to take part in the competition. I thought initially that there will be a separate leaderboard for them. But now I see Chmel_Tolstiy in the analytics leaderboard and elizarov in the backend leaderboard.

    Does it mean that Yandex employees compete together with everyone else and potentially they can occupy some of the top-20 spots in the finals for each track? Please clarify this as it significantly influences strategy of choosing the track for the semi-finals for those who qualified to the semi-finals in multiple tracks.

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Employees and juniors have separate scoring for the results of the contests

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        But how do we know who is the employee and who is not in the scoreboard? Or are you saying that there will be separate leaderboards for the semi-finals unlike in the qualification?

        • »
          »
          »
          »
          »
          3 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          We have prepared 3 contests with the same set of tasks: - for external participants - for employees - for school students

          Therefore, we will have separate leaderboards for each group, which will be easier to navigate.

»
4 weeks ago, # |
Rev. 2   Vote: I like it +25 Vote: I do not like it

Has the date of the Semifinal been changed from November 2nd?

According to the schedule on https://contest.yandex.com/yacup/schedule, it overlaps with AtCoder Grand Contest 069, so I would like to request a time adjustment if possible. Yandex maroonrk

Thanks!

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Yes I can postpone the AGC if necessary, but this blog says the semifinals will be held on 2nd Nov, so I want to confirm that the correct date is the 3rd. Could anyone from the Yandex team answer this?

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes, sorry for the confusion. The semifinal will take place on 3 November. The start times of the tracks are different. For example, the semifinal of the Algorithm track will take place on 3 November from 17:00 to 18:00 UTC +3 Detailed schedule here: https://contest.yandex.com/yacup/schedule

      • »
        »
        »
        »
        4 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        We did not foresee that the 2nd of November is a working day in Russia

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

What's the solution for F. Zeroth Rome ?

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Where can I find solutions of problems in algorithm round?

»
3 weeks ago, # |
  Vote: I like it +10 Vote: I do not like it

In problem F, why does code1 result in a runtime error on test 1, while code2 and code3 pass all tests?

It seems something might be off with test 1.

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Do you handle this:

    If the given number k is greater, than the pharaoh wants – he does not wish to answer that many questions, the jury program will respond with the number −1. In this case, you must correctly terminate the program (to receive a correct verdict).
»
3 weeks ago, # |
  Vote: I like it +20 Vote: I do not like it

In the email sent yesterday, it said, "The top 10 participants from the semifinals in each track will head to ancient Tashkent." But elsewhere it says "top 20." Which is correct?

Yandex

  • »
    »
    3 weeks ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Hi! The Algorithm track will have 40 participants in the finals 20 external participants 10 employees 10 schoolers

    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I think I registered as an external participant, so does that mean that email (top 10) is a typo? (I'm waiting for other people's information too)

      • »
        »
        »
        »
        3 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Forty people will advance to the final in the Algorithm track: - 20 external participants - 10 employees - 10 school students

        I would greatly appreciate it if you could send me a direct message indicating which communication mentions only 10 participants on the final.

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Where is the Yandex Algorithm semi-final contest link? Is it the contest time now?

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I messed up the time. The contest is like, 9 hours from now.

    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      The correct start time of the contest is November 3rd at 5:00 PM Moscow time. Perhaps this link will help you get oriented.

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Where is contest link? I qualified but don't see how to enter

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Where is the semi-finals contest link? The mail i recieved says "Go to your account" but there is no link there to enter the competition Yandex ?

»
3 weeks ago, # |
  Vote: I like it +10 Vote: I do not like it

How are ties broken in the Algorithm Semifinals?

»
3 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Is it possible to read problems and watch standings of the algorithms semi-finals while the contest is running?

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Did anybody solve Backend C with DDoS?

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

can we see the problems of semifinals ? Yandex

»
3 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

Could anybody briefly explain how to solve C in algorithms track?

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Check this blog. Problem I is the same as C in the contest. You can see implementation from the github link in the blog

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    Let A be the adjacency matrix. We are looking for the sum of M * A^k where M = [0 0 .... 1 0... ] where 0 is at the v'th place

    We can precompute A, A^2, A^4, .... in n^3 log(n) and then compute M * A^k in qn^2 log(n)

    • »
      »
      »
      2 weeks ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it

      How long does your code work? Constraints sound weird btw. I was writing the code, praying that it would pass the TL.

      (It’s funny that I submitted two solutions: the first one had #define int ll, which passed all tests (3.719s), and the one without that define got a TL. XD)

      • »
        »
        »
        »
        2 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        3s on yandex, and 1.8s on codechef ide. It was close yeah

      • »
        »
        »
        »
        2 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        My solution with the same idea works in 1.4s on yandex. idk if I'm doing anything particularly smart, you can see the code here.

        • »
          »
          »
          »
          »
          2 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          one thing i can think of is you are using arrays instead of vectors. Otherwise, our codes are similiar

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Compute it for all $$$k < 3n$$$ in $$$O(n^3)$$$ time. For fixed $$$v$$$ the answer is a recurrence of size at most $$$n$$$, so use Berlekamp-Massey to recover it, and solve the recurrence in $$$O(n^2 \log k)$$$ time (most BM template will have that recurrence solver)

»
3 weeks ago, # |
  Vote: I like it -35 Vote: I do not like it

Pretty bad contest tbh. Problems A and B are okay I guess? In problem C I knew it needed matrix exponentiation but am not really good with it so after some research I found a blog for Errichto with the same problem so I used the solution. Didn't read problem D, but if my solution for E is intended, it's really bad.

My solution for E
  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    You can find the largest distance from each node by finding the diameter of the subset of nodes with a certain prime factor. To find diameter, just find the farthest node in the subset from an arbitrary node, and then find the farthest node from that node. Precompute LCA distances to compute distances in O(1).

    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yeah that makes sense, still a lot of implementation though

      • »
        »
        »
        »
        3 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        It's only ~30 lines excluding the lca / prime sieve templates.

        Spoiler
    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      There's (imho) an easier way to find the diameter (and it is online!):

      If vertices $$$a$$$ and $$$b$$$ are the current diameter, and there's a vertex $$$c$$$ inserted to the set, then the new diameter is either $$$(a, b)$$$, $$$(a, c)$$$ or $$$(b, c)$$$

      • »
        »
        »
        »
        3 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Nodes might get deleted from the set though

        • »
          »
          »
          »
          »
          3 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Wdym? You just store the set for each prime

          • »
            »
            »
            »
            »
            »
            3 weeks ago, # ^ |
              Vote: I like it +16 Vote: I do not like it

            Nvm I think I got it wrong

»
3 weeks ago, # |
  Vote: I like it +46 Vote: I do not like it
The comment removed because of Codeforces rules violation
  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Would be much better to have $$$T <= 100$$$. Spent so much time hardcoding all the base cases / tail optimization.

    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Why would you need to hardcode or optimize anything?

      • »
        »
        »
        »
        3 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        if you try doing for power <= p, formula and for power > p, "pure" bruteforce, it becomes hard

        (i did for power >= 3, store them in a list and prefix sums, which passes easily)

        • »
          »
          »
          »
          »
          3 weeks ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          Yeah, I had to do formula until power $$$p <= 5$$$ and bruteforce for the rest. Had a bunch of code that looks like this to squeeze into TL.

          Unless there's a much simpler solution.

          	if (R < 2) {
          		return 0;
          	}
          
          	// special case: two digits
          	auto ans = Modular(R - 1) * Modular(R) / 2 * 2;
          
          	// three digits
          	long long n = sqrt(R);
          	auto threes = Modular(R + 1) * (n - 1);
          	// subtract 2^2 + .. + n^2
          	threes -= Modular(n) * Modular(n + 1) * Modular(n * 2 + 1) / 6 - 1;
          
          	ans += threes;
          
          	// four digits
          	long long low = 1, high = 1e6;
          	while (low <= high) {
          		long long mid = (low + high) / 2;
          		if (mid * mid * mid <= R) {
          			n = mid;
          			low = mid + 1;
          		} else {
          			high = mid - 1;
          		}
          	}
          
          	auto fours = Modular(R + 1) * (n - 1);
          	// subtract 2^3 + ... + n^3
          	auto sums = Modular(n) * Modular(n + 1) / 2;
          	sums = sums * sums;
          	fours -= (sums - 1);
          
          	ans += fours;
          
          	// five digits
          	low = 1;
          	high = 32000;
          	while (low <= high) {
          		long long mid = (low + high) / 2;
          		if (mid * mid * mid * mid <= R) {
          			n = mid;
          			low = mid + 1;
          		} else {
          			high = mid - 1;
          		}
          	}
          
          	auto fives = Modular(R + 1) * (n - 1);
          	// subtract 2^4 + .. + n^4
          	sums = Modular(n) * Modular(n + 1) * Modular(n * 2 + 1) * Modular(n * n * 3 + n * 3 - 1) / 30 - 1;
          	fives -= sums;
          	ans += fives;
          
          • »
            »
            »
            »
            »
            »
            3 weeks ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            there are only <= 10^6 relevant numbers for powers >= 3. You can just binary search on a vector of those numbers after precomputing?

          • »
            »
            »
            »
            »
            »
            3 weeks ago, # ^ |
              Vote: I like it +10 Vote: I do not like it

            Attaching the core of my solution; sounds similar to what has been mentioned above minus binary search.

            Spoiler
    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It's just that it's code is pretty messy because of the r <= 10^18 condition so lotsa mods would've been much cleaner for r <= 10^9

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

27th place, any chance? Yandex were there any people <= 26 rank who are employees/school?

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    schoolers have seperate standings :(

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    There's a chance of 7 people above you rejecting their invitation :D

    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it +16 Vote: I do not like it

      yep i know, if anybody is rank <= 26 and does not plan to attend, feel free to reply here thanks

      • »
        »
        »
        »
        3 weeks ago, # ^ |
          Vote: I like it +10 Vote: I do not like it

        same but for rank <= 24 haha :)

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Does someone who solved F really quickly mind sharing their solution (e.g., hos.lyric)?

I got sidetracked for a while (misreading the problem at first, then trying to optimize a solution idea that was getting TLE38 but was actually wrong). Even if I had come up with the correct idea from the beginning there's no way it would have taken me less than twenty minutes to solve. :)

  • »
    »
    3 weeks ago, # ^ |
    Rev. 2   Vote: I like it +10 Vote: I do not like it

    I used a dynamic Aho Corasick with a small to large technique on tree. This works in $$$O(S \log^2 n)$$$ but passed in 2.5s.

  • »
    »
    3 weeks ago, # ^ |
    Rev. 2   Vote: I like it +40 Vote: I do not like it

    Build Aho-Corasick on $$$s_i$$$'s. For query $$$(v, t)$$$ traverse the trie by $$$t$$$ and at each node $$$x$$$ we want to count the vertices (of the input tree) in the subtree of $$$v$$$, marked on $$$x$$$-root path of the trie (following the failure link). This is already a 2D query problem. We can scanline the DFS order of the trie to achieve 1 log.

    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it +20 Vote: I do not like it

      If you DFS on the failure link tree, then you can maintain set of points in the root-node path for all nodes (add to set when entering it, and remove from set when leaving it).

      We need to count the number of points under the subtree of input tree quickly, so maintain that DS with Fenwick trees indexed by DFS preorder.

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Although I didn't finish it in time because of slowness on other problems, the idea I had which was not hard to implement was: Given that you have s[i]'s in order of DFS in numbers, the problem is basically a range count query. We can solve this offline, by slowly adding the s[i]'s in a Aho-Corasick which you can add words to (it has an extra log factor, and uses the standard log(n) versions of the DS trick). I already had this dynamic Aho-Corasick code. And then you just need to subtract two prefixes to get the result of a range query.

»
3 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

anyone mind to post semifinal solutions?

»
2 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

When will the problems and standings of the Algorithm semi-finals be available to outside spectators?

»
32 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Has the finalists of each track been announced?