Автор awoo, история, 5 лет назад, По-русски

Привет, Codeforces!

В 14.07.2021 17:35 (Московское время) состоится Educational Codeforces Round 111 (рейтинговый для Див. 2).

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ICPC. Штраф за каждую неверную посылку до посылки, являющейся полным решением, равен 10 минутам. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 6 или 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной придумывали и готовили Адилбек adedalic Далабаев, Владимир vovuh Петров, Иван BledDest Андросов и Максим Neon Мещеряков. Также большое спасибо Михаилу MikeMirzayanov Мирзаянову за системы Polygon и Codeforces.

Удачи в раунде! Успешных решений!

Также от наших друзей и партнёров из Harbour.Space есть сообщение для вас:

Привет, Codeforces!

Из Барселоны в Бангкок. Мы официально открываем наш новый кампус в августе.

Как некоторые из вас, возможно, знают, Harbour.Space University в партнерстве с University of the Thai Chamber of Commerce в Бангкоке предлагает выдающимся техническим специалистам возможность учиться в одном из самых динамичных и ярких городов мира.

Чтобы отпраздновать запуск, у нас есть стипендии для программ бакалавриата и магистратуры, включая: Data Science, Cyber Security, Front-end Development и Computer Science.

Codeforces and Harbour.Space

Требования:

  • Свободное владение английским языком
  • CV
  • Тест по математике и информатике
  • Диплом (и приложение с перечнем изученных предметов) о наивысшем достигнутом уровне образования

Кандидатам на магистерскую программу Front-end Development необходимо будет отправить задание.

Мы всегда рады видеть членов сообщества Codeforces, которые присоединяются к семье Harbour.Space. Чтобы получить шанс учиться у лучших в этой области и начать свою карьеру, подайте заявку прямо сейчас на одну из следующих программ:

Следите за новостями в LinkedIn, чтобы не упустить новые возможности. А так же загляните в наш Instagram, где мы делимся событиями студенческой жизни и историями успеха наших учеников.

Желаем удачи и до встречи в следующий раз!

Harbour.Space University

Поздравляем победителей:

Место Участник Задач решено Штраф
1 jiangly 6 136
2 neal 6 177
3 End. 6 186
4 Bench0310 6 211
5 Geothermal 6 212

Было сделано 289 успешных и 677 неудачных взломов.

И, наконец, поздравляем людей, отправивших первое полное решение по задаче:

Задача Участник Штраф
A Geothermal 0:00
B Geothermal 0:02
C TheScrasse 0:07
D jiangly 0:27
E Andreasyan 0:18
F TheOneYouWant 0:40

UPD: Разбор опубликован

  • Проголосовать: нравится
  • +289
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -21 Проголосовать: не нравится

Hope to be pupil after this round!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

very nice number, I hope there will be a good round with nice problems.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

After so long time educational round hope learn something new from it

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +176 Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

I hope to finally be expert after this round :)

»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится +31 Проголосовать: не нравится

Educational Codeforces Round 7

Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Hoping for a good contest :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Love Educational rounds very much!! Hope to go ++.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -13 Проголосовать: не нравится

Love Educational rounds very much!! Hope to go ++.

UPD : wth guys, why these downvotes lmao? people dont like educational rounds?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

I hope everyone can rate growth.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Hoping for a Good and Fair Contest. Hackers are all set to hack :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

ALL THE BEST GUYS.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I wish problem rating updated soon to judge my level, Educational round problem rating updated too late many times :), But Educational round is interesting.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Hey guys, I received a report :"Rating changes for the last round are temporarily rolled back. They will be returned soon." . What does it mean???

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

Hope to be pupil after this round!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -22 Проголосовать: не нравится
Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hope to get as much positive delta as this round number(also very symbolic) is. Good luck every one!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

There are more than 20K+ participants registered for this contest but why the upvote is only 222 at least everyone upvotes the contest.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

how to be specialist after this round

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -71 Проголосовать: не нравится

Can I get some down votes please !!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The contest of beautiful arrays and numbers!

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +156 Проголосовать: не нравится

terrible difficulty gap.

Update after the contest:E is easier than C imo

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +45 Проголосовать: не нравится

Pupils are unable to solve C.

Masters are unable to solve C.

Perfectly balanced as all things should be.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +40 Проголосовать: не нравится

I'm indeed educated

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

my hopes of being specialist have been shattered ;-;

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -53 Проголосовать: не нравится

can u someone the problem to me...if all subarray is good for tst cs 1 then ans should 4C1+4C2+4C3+4C4 =15

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -74 Проголосовать: не нравится

Amazing contest! Enjoyed it!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

The gap between B and C is so terrible that I spent an hour to do it :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

Gotta be one of the most unbalanced problemsets

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Really cool problem E!!! But my 122504290 takes 2s and 166MB so I wonder if it is the intended solution.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

May be today C is the hardest C for some recent educational !

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +27 Проголосовать: не нравится

I didn`t want to write till end, but this is really speedforces. Pretty big difficulty gap between C and D. I think it is bigger than it should. But still, thanks for the round. Waiting for editorial.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +26 Проголосовать: не нравится

When you realised C was just about one DAMN observation — that you need to check only subarrays of size 3 and 4.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    why ??

    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +8 Проголосовать: не нравится

      Three indexes is a bad triple if arr[i] <= arr[j] <= arr[k] or arr[i] >= arr[j] >= arr[k] and i < j < k.
      min(Longest Non-decreasing Subsequence, Longest Non-increasing Subsequence) of every array of length 5 is >= 3. So, every array of length 5 or more is automatically bad

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    When you realised C was just about one DAMN observation — that you need to check only subarrays of size 3 and 4.

    What if someone didn't make this particular observation and just implemented checking subarrays of size 3, 4, 5, 6, 7, 8 and so on in the most straightforward fashion? Their solution would always bail out on subarray of size 5 anyway (so sizes of 6, 7, 8 won't be tested) and thus avoid TLE. Submission 122458692 is a very good example of this.

    When trying to hack various accepted solutions for problem C, I noticed that the opportunities to TLE them are very much limited. Moral of this story: don't give up even if you missed an important observation. Your "silly" bruteforce solution with multiple nested loops may actually have $$$O(N)$$$ time complexity, just because the observation that you failed to notice still benefits you nevertheless.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +51 Проголосовать: не нравится

Solution of F -
Lets create a graph with edge from $$$i$$$ to $$$j$$$ with cost $$$|d - |a_i - a_j||$$$. Let's define the cost of a path as max edge weight along the path. Then minimum $$$k$$$ required to go from $$$s$$$ to $$$i$$$ is path with minimum possible cost from $$$s$$$ to $$$i$$$. This graph has $$$O(n^2)$$$ edges.

Let $$$i , j$$$ be the two stones and $$$a_j - a_i \gt = d$$$. Then instead of jumping from $$$a_{i-1}$$$ to $$$a_{j+1}$$$ its always better to go along $$$a_{i-1}$$$ to $$$a_{j}$$$ to $$$a_{i}$$$ to $$$a_{j+1}$$$. So lets not add $$$i-1$$$ to $$$j+1$$$ edge.

Let $$$i,j$$$ be the two stones and $$$a_j - a_i \lt = d$$$. Then instead of jumping from $$$a_{i+1}$$$ to $$$a_{j-1}$$$ its always better to go along $$$a_{i+1}$$$ to $$$a_{j}$$$ to $$$a_{i}$$$ to $$$a_{j-1}$$$. So lets not add $$$i+1$$$ to $$$j-1$$$ edge.

Now reduced graph has $$$O(n)$$$ edges.

To answer queries we can process offline in increasing order of k and maintaining connected components such that the cost to reach from one node to another in the same component is atmax k.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    In your solution 122498108 can you explain why you only need R = 1 and not any larger value of R? I can see that for all examples of using those edges one can connect the whole graph but I can't find a proof or good explanation as to why. Thank you.

    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      My first submission had R=2. Later on, I submitted R=3,4 at last R=1 as well.
      I didn't prove rigorously for R=1 and was expecting WA and later on hack. But awoo did stress tests and this submission did pass them.
      Edges in my submissions may not be sufficient if it's a poor implementation but the idea remains the same.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

i used dp for problem A.Does anyone have a better idea for problem A? And i want to ask more about the solution to problem C. thanks a lot !

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve problem C?I can't think of it.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

How to solve D ? I thoutht like this.

First fix a vertex. For convenience lets fix 1. and lets assume we are going to give the value 'x' to it. l <= x <= r.

Then for each vertex either give 0 or 1. If it is one, the value of the that node is i — x + 1, else it is i + x — 1.

Then how to find the number of values satisfying the above condition that the value of the node is l <= x <= r.

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 5  
    Проголосовать: нравится +6 Проголосовать: не нравится

    Well there are multiple steps, but the first crucial observation you have to make is that the final array will be in a form of a_i = i+k or i-k (k is a constant positive integer). So you have to figure out a way to loop through the possible k values. The next step is that you realize for most k, the number of ways of arranging an excellent array will be simply nC(n/2) for even numbers and for odd numbers, if we let x = (n+1)/2, and y = n — (n+1)/2, then it will nCx+nCy. So if you somehow reduce the range of k you have to calculate, then you can simply naively loop through the rest of the range, which will result in O(n) solution.

    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      How is the number of ways of arranging will be nCn/2 why exactly only n/2 elements can have i+k / i-k? And could you elaborate the part why we need to do separately for even and odd part ?

      • »
        »
        »
        »
        5 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится 0 Проголосовать: не нравится

        Let x be the number of a_i = i+k, and y be the number of a_i = i-k, then it is quite obvious that x+y = n. Also from this simple setup, we can actually calculate the value of F(a). When we choose one of x numbers and one of y numbers, it contributes 1 to F(a) (because a_i+a_j = (i+k)+(j-k)=i+j), so it is basically going to be F(a) = x*y = x*(n-x), and we want to maximize this value. Simple calculus tells us that this function is at maximum when x is closest to the value n/2, so for even it is just x=y=n/2, whereas for odd numbers, n/2 is not an integer, so we have to resort to (n-1)/2 and (n+1)/2. From this basic analysis using calculus, it is clear that we have to choose n/2 numbers out of the array to have i+k, and the rest to be i-k. Thus, nC(n/2) (n:even) or nC((n-1)/2) + nC((n+1)/2) (n:odd)

    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      But there can be cases when for some k's you can't choose nC(n/2). For example when l=4 and k=3 for i's up to i = 7 there couldn't be a[i]-3 in array, so it will be at list (n-6)C(n/2) and there could be the same issue with r value and last elements. So you need to find k's not effected by this — they are -lim <= k <= lim, where lim = min(max(0, r-n), max(0, 1-l)) and for every other you should count number of elements excluded from change and find (n-ex_l-ex_r)C(n/2-ex_r) and (n-ex_l-ex_r)C(n/2+1-ex_r). Is it right? If so, how to do it quick?

      • »
        »
        »
        »
        5 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится +3 Проголосовать: не нравится

        The key is that there are only O(n) possible situations where you have to manually calculate the value, so you don't really have to calculate them quick. And as you have mentioned, for the values 1<=k<=lim (k being negative would lead to counting the same cases twice since a_i = i- k is essentially a_i = i+ (-k)), you can simply multiply lim to the formula nC(n/2) for even and vice versa. Also, there is an intuitive way to think about why there would be only O(n) brute force cases: When k increases, the number of values in the array that have to be a_i = i+k or a_i = i-k will strictly increase because more values will be out of bounds (a_i = i+k or i-k) and since the size of the array is O(n), the number of brute force cases will also be O(n)

    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Why such and only such arrays ($$$a_i = i \pm k$$$) are excellent?

      • »
        »
        »
        »
        5 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится +3 Проголосовать: не нравится

        Let's say there are offsets, a and b such that for some indices i,j of the array, a_i = i+a, a_j = i+b. Then, in order for a_i and a_j to contribute to F(a) (since we want to maximize F(a)), a_i +a_j = i+j + (a+b) = i+j, so this would only occur when a+b = 0, so a = -b. We can think that a and b are "compatible" in this case and it is obvious that only compatible pairs would contribute to the function F(a). Having values that have different absolute values would decrease the number of "compatible" pairs, since they can be only compatible if and only if the other offset has the same absolute value and is negative. Hence, only when we have two offsets (k, -k) that are compatible the F(a) can be maximized. Formally, I think you could use some sort of exchange argument, but intuitively this is what I came up with during contest

    • »
      »
      »
      5 лет назад, скрыть # ^ |
      Rev. 3  
      Проголосовать: нравится +5 Проголосовать: не нравится

      @Bungmint Congrats on solving D during the contest. Had the right idea at the contest but it took me 2 days (after work but still) to complete it :-) Amazing how the top performers do it in 15-20 minutes.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

Missed E by just 3 min :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Please I need hints for problem B

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    the hint of problem b is an observation about how the values a and b affect the final answer. Can we say that no matter how we slice the contribution of a in the answer will be same. Now try to think how the value of b affects the answer and what happens when it goes negative.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

I hate green color I love gray color thanks codeforces.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

This contest is an example of perfect Cf contest. Problems were not direct and required some amount of thinking and there was no sudden increase in difficulty(in case of B and C). Simply loved the contest.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Lets LIS be Longest Non-decreasing Subsequence and LDS be Longest Non-increasing Subsequence. Lets F(arr) = max(LIS(arr), LDS(arr)). Whats the minimum F(arr) we can get for array of length N?

Its question from selection round in Summer Computer School (Round is already over), but because its related for todays C, I think I can ask here

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +18 Проголосовать: не нравится

    I think it's $$$\lceil \sqrt{N} \rceil$$$ as Dilworth's theorem gives a lower bound, and it can be easily constructed by grouping elements in an interval of $$$[i\sqrt{N},(i+1)\sqrt{N})$$$ in increasing order and then sort the groups in decreasing order.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to do B? Any short way?

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    If b>=0 , then just pick every element one at a time to maximize points.
    Else if b<0 , then one-by-one pick continous substrings with ( value != starting value(str[0]) ) and then pick remaining substring in one move.
    Reason for picking 2nd group for b<0 :- Because group of elements which is not equal to first element will always 1 less than or equal to other group. It can't be more than other group. So value of b which is (-)ive will be added less no. of times.
    You can check this — 122468733

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

my first contest .. so can anyone tell when rating comes ??

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

How to solve D?

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +6 Проголосовать: не нравится

    I have a solution for even numbers, so I didn't pass the tests, but I'm sure it's almost complete solution. Firstly notice that in order for the given formula to be correct, meaning $$$a_i + a_j = i + j$$$, integers $$$a_i$$$ and $$$a_j$$$ should be of form $$$i + k$$$ and $$$j - k$$$. So for example $$$a_5 + a_3 = 5 + 3$$$ holds for $$$a = 7$$$ and $$$b = 1$$$, which is the same as saying $$$a = 5 + 2$$$ and $$$b = 3 - 2$$$.

    So we can notice that we can traverse every $$$i$$$ from 1 to infinity, but the constraints are a bit too large for this. However, we can also notice that we can add or subtract any number between 1 and $$$min(1 - l, r - n)$$$ to each of the numbers without leaving the bounds. We can clearly see that subtracting any of the value in these bounds won't exceed $$$l$$$ nor $$$r$$$.

    So this means that there are exactly $$${{min(1 - l, r - n)}\choose{n/2}} + x$$$ ways where x represents the number of ways when we can't choose two options for every single integer. This however is easily solvable, because you can notice that if for some $$$p$$$, $$$a_k + p \gt r$$$, then we can guarantee that $$$a_k + (p + 1) \gt r$$$ and $$$a_k - 1 + (p + 1) \gt r$$$, meaning $$$a_{k-1} + (p + 1) \gt r$$$. Similar statement holds for $$$q$$$ for which $$$a_k - q \lt l$$$. So just find the border value between these two cases (select all and select only some). Once you find the edge value it's easy to notice that you can bruteforce every value $$$\geq p$$$ as there are at most $$$n$$$ such values. Hope this helps.

    The problem I encountered is bruteforcing for odd $$$n$$$, so this solution fails on the last and first number of first test, but solves the second and third. I'd appreciate if somebody provides a workaround for this. Thanks.

    EDIT: I see I made a mistake which made the explanation sound poor.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Hello, I wasn't able to solve C, but while thinking on it's solution , I stumbled on a different problem.

How to find the next kth larger number in an array for an index i?

Can someone tell me how to solve this in $$$O(n)$$$?

I think a monotonic stack can be used, but I am not sure about the implementation.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I applied this approach for solving B still my test case 2 fails. What's wrong with the approach?

https://mirror.codeforces.com/contest/1550/submission/122490178

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Is there a formula/dp for finding the number of trees in which the distance between 2 fixed labels is even/odd?

Reduced D to this but got stuck, thanks

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +29 Проголосовать: не нравится

Problem E is both fun and educational, I really like it. Thanks for this brilliant round!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can somebody tell what is the third not good subarray in 2nd test case of problem C?

6 9 1 9 6

I only discovered [6 9 1 9], [6, 9, 1, 9, 6]

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +36 Проголосовать: не нравится

there're two types of people: those who have found the observation in C and those who haven't...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I think problem F would be more interesting if s were different for queries

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

how to solve problem C?

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +5 Проголосовать: не нравится

    You can put 5 points on paper and become sure that there is 1 bad triple (at least).

    First put 2 points and indicate the area where you can't put the third one. Then add third and then forth. And you can see that you have not enough area for fifth.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

Is CodeForces making me stronger or bullying me?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +10 Проголосовать: не нравится

can someone help me with a counter case for C My idea ->
using 2 pointer triplet will be bad if any number between start and end is bound by minimum and maximum among starting pointer and ending pointer.

https://mirror.codeforces.com/contest/1550/submission/122495304

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

any idea on how to solve problem C?? my idea was any increasing or decreasing subsequence of length 3 is a bad triple. Got the idea to implement dp using a start and end as the state but it would give time complexity.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

When the editorial will be post?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

Video Editorials of this Round A. Find The Array B. Maximum Cost Deletion

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

General question, what makes a contest "educational" compared to a regular div 2 contest?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone explain the solution of D ?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

man educational rounds are always tricky .

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone explain why a does not effect the answer in problem B ?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

If some people wish to write the things/topics they found educational in A,B and C, it'll be very helpful for me (and I think for others also). So, please do write if you have some time. TIA.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится

Sorry for the bad stream :(
We should have considered making the stream hidden from the sidebar.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

лучший раунд в моей жизни

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +33 Проголосовать: не нравится

I found this person:

Spoiler

Still continuing to send and hack!!

»
5 лет назад, скрыть # |
Rev. 5  
Проголосовать: нравится +59 Проголосовать: не нравится

For everyone wondering why a good subarray cannot have length greater than $$$4$$$ in $$$C$$$. There is a theorem Erdos Szekeres which basically states that any sequence with length greater than $$$xy$$$ must have either a non-increasing subsequence of length $$$x+1$$$ or a non-decreasing subsequence of length $$$y+1$$$ or both.

Put $$$x = y = 2$$$ for this problem.

Hint for proving this theorem:

Hint
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Hi guys, I haven't tried out hacking feature yet on codeforces so was trying out this time and had some doubts:

  1. Is there any penalty on unsuccessful hack attempt?
  2. I can see that I can hack my solution as well. I don't think this makes sense as then the user can hardcode some condition where it will fail and then hack it to get points.
  3. Is it possible to hack one solution multiple times. For eg. if user A hacks user B, can user C also hack user B ?

For the second point, someone is using the same flaw which i mentioned :

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve D?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hello everyone, it would be really helpful if someone explains the detailed proof of problem C in an easy way so that all the newbies like me get the things clear and able to learn some new concepts. why a good subarray cannot have a length greater than 4 ?????

please help!!

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    The first thing is that if points A, B, C (and A.x < B.x < C.x) are in a bad triple then point B lies in a rectangle formed by points A and C. It can be proven just by considering several cases.

    Then it's clear that for any point from a good array (let its coordinates be X and Y), there are no points before that have less/bigger Y coordinate and after that have bigger/less coordinates is the same time. Otherwise, we could choose them to form a rectangle, in which our point lies.

    From here, in any good subarray with 4 elements, the second element is the biggest/smallest and the third element is the smallest/biggest (it can be proven by contradiction). If we add the fifth element, then the fourth point will lie in a rectangle formed by either points 2 and 5 or point 3 and 5. As soon as, every subarray of a good array is also good, there would be no good arrays with length greater than 4.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

"Educational"

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

How to know in educational rounds whether sys test has been completed after open hacking phase finished ?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Does anyone know what does the meaning of 00:30 or 01:26 means below the + sign.

Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится -29 Проголосовать: не нравится

Educational round rating pending ... 2 hr later ... rating pending ... hacking phase ends ... rating still pending ... 200 hr later ... rating still pending ... 2000 yrs later ... rating still pending .... 2 million yrs later ... Finally updated.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

when's the editorial coming out?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -23 Проголосовать: не нравится

Guys, When will my rating update ???

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is there any editorial in this round? Keep waiting...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

Auto comment: topic has been updated by awoo (previous revision, new revision, compare).

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

is the system testing over?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

isn't it rated? then why my rating didn't change?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My Code for C is running in 592ms, will it FST?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +44 Проголосовать: не нравится

To not keep you waiting, the ratings updated preliminarily. In a few hours/days, I will remove cheaters and update the ratings again!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

During the 12 hours hacking stage, I received a very strange DM from someone, who claimed to be an alt account of myACEY. This person asked me about how I managed to hack 122468435 and what was their mistake. But I noticed that myACEY's account is primarily using Python and another account is using C++, sometimes they participated in the same contests and solved different number of problems using very different solutions (so nothing suggests that both accounts could be owned by the same person). I responded "How can I be sure that it was really your account?" and never heard anything back. Now this is eating me a bit. Am I a bad person because of being too paranoid and refusing to share information with a fellow competitive programmer?

As for the hack, that solution was already a bit slow (717 ms on pretests). The amount of calculations it performs depends on $$$s$$$. Processing some $$$s$$$ values is much slower than the others, and $$$s=4902$$$ was one of the worst. So constructing a testcase with 4902 repeated 5000 times pushed myACEY's solution over the 1000 ms time limit. Now this hack is a standard testcase #4 of the A. Find The Array problem and it was included in system tests too (even though I doubt that it managed to catch anyone else).

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

Auto comment: topic has been updated by awoo (previous revision, new revision, compare).

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

289 successful hacks and 677 unsuccessful hacks were made in total!

The numbers should be 110 out of 498 if we subtract my 179 pointless self-hacks.

It was a game, and it was fun XD

and don't ever think of doing this, solve problems instead!