Блог пользователя TeaTime

Автор TeaTime, 19 месяцев назад, перевод, По-русски

Хаюшки, Codeforces!

Мы с радостью хотим пригласить всех принять участие в Codeforces Round #815 (Div. 2), который состоится в 18.08.2022 16:35 (Московское время). Вам будут предложены 5 задач, одна из которых содержит подзадачу и 2 часа на то, чтобы их решить. Мы рекомендуем вам прочитать условия всех задач!

Раунд полностью подготовлен и составлен учениками ЛКШ (Летняя Компьютерная Школа). В течение смены наши ученики придумали и подготовили для вас интересные и креативные задачи. Вы можете ознакомиться с предыдущими раундами, подготовленными учениками ЛКШ: Codeforces Round #612, Codeforces Round #530, Codeforces Round #694.

Люди, которые приняли участие в подготовке раунда:

  • Задачи придумали и подготовили: Кирилл kirill.kligunov Клигунов, Глеб glebustim Устименко, Алексей daubi Васильев, Станислав Death_on_2_Legs Алексеев, Владимир plagues Герасиков, Артем artem3605 Абатуров, Артем a.stepanov281005 Степанов, Евгений pakhomovee Пахомов, Виктор robivirt Кривощеков под руководством Михаила meshanya Пядеркина, Николая budalnik Будина, Филиппа philmol Молодцова, Владимира TeaTime Новикова, Федора fastmath Ушакова.
  • Особая благодарность за невообразимую помощь в тестировании: Дмитрию Sweezy Пугачеву, Алексею Mangooste Михненко.

Хотим особенно поблагодарить:

  • Artyom123 за качественную координацию и полезные замечания.
  • fastmath за улучшение одной из задач!
  • meshanya за предложение по улучшению структуры контеста!
  • MikeMirzayanov за прекрасные платформы, Codeforces и Polygon!

Разбалловка: $$$500-1000-1250-(1500-1000)-2750$$$.

Удачки!

UPD1: Разбор

UPD2: Победители!

Div 2:

Div 1:

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

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Gl Hf

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +45 Проголосовать: не нравится

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

      why in system testing our answer is get TLE or wrong? because of it's added new test cases?

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

        During the contest time, your code successfully run agnist some test case. After the contest, your code again run agnist rest of the data set. But it took extra time than time limit, that’s why you got TLE.

»
19 месяцев назад, # |
  Проголосовать: нравится +67 Проголосовать: не нравится

тян бы

»
19 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Waiting for it!

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Not as a tester, I know that the problem is good since the last contest by SIS students was great.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится -12 Проголосовать: не нравится

    So is your spacecraft on the orbit?

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится -7 Проголосовать: не нравится

    so next time I see your comment about problems are good without testing, I don't participate in that round...

    xd

»
19 месяцев назад, # |
Rev. 3   Проголосовать: нравится +11 Проголосовать: не нравится

[Deleted]

»
19 месяцев назад, # |
  Проголосовать: нравится +48 Проголосовать: не нравится

As an author, I am author.

»
19 месяцев назад, # |
  Проголосовать: нравится +44 Проголосовать: не нравится

as a tester, I tasted this round.

»
19 месяцев назад, # |
  Проголосовать: нравится +67 Проголосовать: не нравится

Если в раунде нет задачи на линк-кат от Death_on_2_Legs, то я не вижу смысла писать этот раунд

»
19 месяцев назад, # |
  Проголосовать: нравится -21 Проголосовать: не нравится

Artyom123 5 problem round. Have to participate!

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

hope to specialist in this round

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hope to pupil in this round

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    Oof, 1199. You'll get to it next time, keep it up!

    Also, there will be recalculation presumably. So, probably you will get +1 after it :D

»
19 месяцев назад, # |
  Проголосовать: нравится -18 Проголосовать: не нравится

I think problem C has a subtask.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

As a participant, I will participate.

»
19 месяцев назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

I hope to use this round to go back to Master.

»
19 месяцев назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Great!This Unusual time allows me not to sleep so late :)))

»
19 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Hope to candidate master in this round

»
19 месяцев назад, # |
Rev. 3   Проголосовать: нравится +7 Проголосовать: не нравится

Good luck to every one!

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hope to pupil in this round

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Coders Time.

»
19 месяцев назад, # |
  Проголосовать: нравится +20 Проголосовать: не нравится

We live in a society...

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

As an entrant, I think I should now go and write the question

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Finally there is a round of normal time for UTC+8! But,there is only 2h but not 2h+15min.May I think it's a little bit easier than round #814(Div.2)? I am just guessing,so it's may easily wrong(

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hope to expert in this round

»
19 месяцев назад, # |
Rev. 3   Проголосовать: нравится +3 Проголосовать: не нравится

Why the announcement does not mention that the time is unusual, and why is it not displayed as client local time?

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hope that the round provided by SIS students is really friendly. Everybody +154!

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I just need 17

»
19 месяцев назад, # |
  Проголосовать: нравится +20 Проголосовать: не нравится

Note the unusual time

»
19 месяцев назад, # |
Rev. 2   Проголосовать: нравится +6 Проголосовать: не нравится

[Not relevant]

»
19 месяцев назад, # |
Rev. 6   Проголосовать: нравится -14 Проголосовать: не нравится

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    Son, there are other CP websites other than this amazing platform so if you are so mad just don't come here again it is that simple.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Just a simple question: is the link of "Codeforces Round #815 (Div. 2)" in "We are proud to finally invite you to participate in Codeforces Round #815 (Div. 2), which will start on Thursday, August 18, 2022 at 13:35." from the post above correct? It says "https://codeforces.com/blog/entry/103966" here.

»
19 месяцев назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

5 problems and 14 authors :/

»
19 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Hope to master this round!

»
19 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Almost woke up late, didn't realize the one hour early unusual timing, almost missed the contest.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    Me too. I hate the changes in the time of the contest. At least they should write "Please Note the unusual time"

»
19 месяцев назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

Was waiting for the contest to have some fun, turns out that can't even solve problem A.

»
19 месяцев назад, # |
Rev. 3   Проголосовать: нравится +16 Проголосовать: не нравится

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

    Me after 1 hour after not even able to solve A:

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    D2*

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

      can u plz give some hints for d1 i was totally blank for it during contest no Clues and how to think for this kind of problem??

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

        I thought because all a[i] < 200 it won’t matter a lot in the xor operation because the 8th bit and higher will not be affected (2^8 xor a[i] ≈ 2^8), so i divided the array in blocks of size 2^8(256), then cannot exist a subsequence in more than one block (indices i < j) then a[i] xor j < a[j] xor i, and finally eliminate a[] because its small and j < i its false, so you only need to run a standard LIS algorithm inside every block and return the largest subsequence among them.

»
19 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

missed the contest because of unusual start time, thanks.

»
19 месяцев назад, # |
  Проголосовать: нравится +21 Проголосовать: не нравится

Please highlight in bold about unusual start time. Missed the round >︿<

»
19 месяцев назад, # |
  Проголосовать: нравится +39 Проголосовать: не нравится

Problem D, what about the array B meaning?

It looks like array B is a index of array A, but I find all page with ctrl+F, not found the word "index" in problem statement(found in problem note, but not useful).

So, the problem writter, do you know what "subsequence" mean? Read about your sentence: "is a subsequence of length m of the array a.", the reviewer of this problem really think that express the meaning correctly?

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

    I asked a similar question and it turns out that b is actually a index of array A.

    • »
      »
      »
      19 месяцев назад, # ^ |
        Проголосовать: нравится +6 Проголосовать: не нравится

      Only after reading this thread, I understood the question properly. But, is it allowed to discuss about the problem statement during the contest ? Just wondering. :?

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

        I know it so I just repeated the problem writters' words. Seems lots of people got stuck on it.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

    I asked the same thing in dashboard help window and author replied "Read statement again". Like seriously???

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +4 Проголосовать: не нравится

    sameeee. I wasted around 1 hour coding the solution and later realised it's index array.

»
19 месяцев назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

I think the problem A is harder than problem B&C...QWQ

»
19 месяцев назад, # |
  Проголосовать: нравится -35 Проголосовать: не нравится

speedforces, penaltyforces, guessforces.

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

    Not really, but I actually did fail on D1 for 4 times. For misunderstanding!

    I just think the gap between D1 and D2 is a bit big.

    B and C are much easier than A!!!

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

The arrangement of difficulty is really puzzling.

»
19 месяцев назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

I can't solve A !! ◑﹏◐

»
19 месяцев назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

wasted all my time on D1 by assuming that b array contains elements of array a such that elements belongs to [0, n). After seeing tc 1 realised that it's a index array. Was it mentioned in the problem?

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

What's the pretest 3 of D fix? Pretty convinced my 2D DP solution is correct (trying to match bits one by one and storing maximum for each pairing of index 'bit prefix' and 200 last values). Thanks.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +14 Проголосовать: не нравится

    I can't see your solution, but seems you overcomplicated. Just do these loops:

    for (int i = 0; i < n; i++) {
        for (int j = i - 400; j < i; j++) {
            ...dp transition...
        }
    }
    

    $$$a \oplus b \in \{a - b, a + b\}$$$ hence $$$a_j \oplus i < a_i \oplus j \implies i - 200 < j + 200 \implies j > i - 400$$$. Probably, there is some $$$\pm 1$$$ mistake.

»
19 месяцев назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

what subsequence mean???

»
19 месяцев назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

Div2 D Ok, we can use dp to find the longest sequence, but how do we find all such pairs of numbers that meet xor restriction in a good time? Or there is another approach?

»
19 месяцев назад, # |
  Проголосовать: нравится +50 Проголосовать: не нравится

I always fall behind on problems like A because people submit random guesses. Honest thanks for the weak pretests, they are good from time to time for punishing this strategy.

»
19 месяцев назад, # |
Rev. 3   Проголосовать: нравится +19 Проголосовать: не нравится

In B

$$$max(a_{1}, a_{2}, ..., a_{l - 1}, a_{r + 1}, a_{r + 2}, ... ,a_{n}) - min(a_{1}, a_{2}, ..., a_{l - 1}, a_{r + 1}, a_{r + 2}, ... a_{n}) + max(a_{l},...,a_{r}) - min(a_{l},...,a_{r})$$$

I don't know if it's just me but it took me a while to notice that $$$a_{l}...a_{r}$$$ were missing in the first $$$2$$$ expressions. Stating it in words would have been nice. e.g. The max/min without the subsegment $$$a_{l},...,a_{r}$$$.

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

    +1

  • »
    »
    19 месяцев назад, # ^ |
    Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

    What was your understanding of the meaning of the formulars instead?

    I mean, at first I did not understand them at all for more or less same reason. But there is also no other meaning possible, so I understood after second or third reading.

»
19 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

I don't understand Problem D.

In the example 1,the last factor is equal to n.

But the Note says "In the first test case, we can pick the whole array as a beautiful subsequence".

Why?

Please forgive my poor English.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +10 Проголосовать: не нравится

    In the first test case, you can pick the whole index array [0, 1] as a beautiful subsequence, not the array itself.

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

      I see. Thank you.

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

      Thanks, I was not able to understand the problem until I read your comment.

      The words is a subsequence of length m of the array a. were confusing me so much that I didn't even think that it could be an index array!

»
19 месяцев назад, # |
  Проголосовать: нравится +33 Проголосовать: не нравится

The word "subsequence" in D is quite misleading...

»
19 месяцев назад, # |
  Проголосовать: нравится +24 Проголосовать: не нравится

Why does the subsequence of an array is its index array???

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

What is the intended complexity of $$$D1$$$? I tried an algorithm of $$$O(N*log(N)*max(a[i]))$$$ using trie but it was not enough to pass the time limit.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

What is the hack for A? Is it related to precision issues?

  • »
    »
    19 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +16 Проголосовать: не нравится

    There is no "the hack". I hacked four times, each time in a different way. There was no typical mistake, each wrong solution was just random wrong logic.

    My hacks:

    1 1 2 3
    1 5 3 10
    3 5 1 7
    3 1 5 1
    

    Precision is definitely not an issue unless you actually calculate in floats/doubles, in which case you 100% can be hacked.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve D1, D2?

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

    trie, think of $$$(i, A[i])$$$ as one thing, at bit $$$b$$$ you will have $$$(i_b, A[i]_b)$$$ which you can think of as a number in base 4, these four numbers form a partially ordered set where each number has exactly one number less than it (so check that in dfs) and two numbers equal to it so recurse on them, to reduce the complexity from $$$\mathcal{O}(n \times MAXA)$$$ to $$$\mathcal{O}(n log(n) + n log(MAXA)))$$$ notice that you can group 0 with 3 and 1 with 2.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    D1 直接暴力

»
19 месяцев назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

it took me 1 hour to understand that the sequence b in problem D is the index of a, and i solved it 3 minutes after the end of the contest. confusing description ruined my contest! worst contest I've ever attended

»
19 месяцев назад, # |
Rev. 3   Проголосовать: нравится +185 Проголосовать: не нравится

Imagine 30 high rated programmers preparing a round and everyone agree with a wrong definition of subsequence :/

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

A fuckload of TLs for C INCOMING!!!

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

    Okay, solutions that do not use cumulative sums seem to pass. Probably, TL should have been more strict.

»
19 месяцев назад, # |
  Проголосовать: нравится +17 Проголосовать: не нравится

Despite the confusing description, D2 is the best problem I've seen in CF div.2 rounds. I think using 01-trie to optimize the transition is quite tricky for me :)

»
19 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Had an idea for D1, but was not able to debug it in time D:

Finally positive delta, so i am not complaining. Nice set overall, regardless B and C being easier than A.

»
19 месяцев назад, # |
Rev. 2   Проголосовать: нравится +67 Проголосовать: не нравится

Get really confused.

In problem D, the statement says that b is a subsequence of length m of the array a. How can $$$b$$$ be a subsequence of $$$a$$$? In the first case of the sample, how do $$$[0,1]$$$ turn to be subsequence of $$$[1,2]$$$?

I spend more than an hour on the version of $$$b_i$$$ is an element of sequence $$$a$$$, not until finding my long code not outputing the correct answer to the sample test. There's even no update or clarification!

It's maybe true that this is explained in the sample. However I do think this kind of description is annoying, as I, urgently, was in a hurry trying to solve the problem and not aware of the misunderstanding.

I should have got an increase in my rating. Anyway... I'm realy down in the dumps. :(

  • »
    »
    19 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +19 Проголосовать: не нравится

    I think probably not only me were confused with the description. Why none of the numerous writers and testers pointed this out? More than 30 names are mentioned, that's a large number even compared to other contests.

    I'm pissed off a bit because there is neither descrition updates nor clarifications during the two-hour contest.

    In the previous contests, I find the clarifications really detailed, sometimes even nagging. However I got nothing this time, when I really nead them. I think a simple short clarification can get me back to track.

    Problems in contests are not like normal training problems, a slight misunderstand can have significant influence on some (maybe one or two, but probably a few) participants.

    Sorry for the bad mood brought to the comments. I promise I will make more contribition to the codefoces society to make this up.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

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

    My solution to the misunderstood version of D1 has come out. The link is here. :)

»
19 месяцев назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

NO WAYYYY T-T JUST GOT FST ON B CAUSE OF JAVA SORTING I'm so sad. ;(

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Many fst in problem A...

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

The pretest of A is so weak!

If you don't use long long,you will also pass the pretest!

»
19 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

took 10 minutes to figure out what problem D means, tried and failed to solve it in the rest hour, and realized that I misunderstood it after the contest:)))))

»
19 месяцев назад, # |
Rev. 3   Проголосовать: нравится +43 Проголосовать: не нравится

I'm quite sure there must be a severe mistake in the D1 statement. It describes $$$b$$$ as a subsequence of $$$a$$$. By definition of subsequence, the elements in $$$b$$$ must be in $$$a$$$, and the relative order of the elements in $$$b$$$ are the same as the relative order of the elements in $$$a$$$.

However, right away from sample-input #1, we have a contradiction. The example shows $$$1 \oplus 1 < 2 \oplus 0$$$, which means the $$$b$$$ values are $$$1$$$ and $$$0$$$. But 0 isn't in the array! How can a subsequence of an array with no zero contain a zero???

I was also confused by test-case #2, where they selected indices 1, 2, and 4. Okay, these are in the array this time, but not in that order! The relative order in array $$$a$$$ is 2, 4, 1. So [1, 2, 4] is not a subsequence of $$$a$$$. I thought they might have meant $$$[2, 4, 1]$$$, but they also wrote that $$$b$$$ is strictly increasing. How does this make sense?

I had over an entire hour after solving C, and could not understand this. Asking a question yielded the generic response of "Read the problem statement", but no matter how much I read it, I couldn't make sense of these.

It was only after the contest, from another comment, that mentioned that $$$b$$$ is actually simply an increasing set of indices of $$$a$$$, completely independent of the values of $$$a$$$. This is not a subsequence. Nowhere in the problem does it mention that $$$b$$$ was a set of indices.

This is an enormous mistake that prevented me (I'm sure many others), from being able to even understand the problem. Not only was there a severe mistake in the original statement, but what's even worse is that this was never corrected throughout the contest, and even the inquiries about this issue were responded with a generic "Read the problem statement". If you're getting questions about a statement, maybe you should like, actually read the statement yourself and figure out why people aren't understanding it, and then correct the problem statement and humbly clarify the issue, as opposed to giving a generic "Read the problem statement" response, as if the questioners are too stupid to understand that a "subsequence" actually refers to a set of indices!!!

  • »
    »
    19 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +10 Проголосовать: не нравится

    But the meaning of subsequence in this problem is given in the problem statement?

    Spoiler

    Just because the word "subsequence" usually mean some element of array in same order doesn't mean it will be the same in this problem. But yeah i agree it can be confusing. Maybe it will be better if without the word "subsequence", just array B.

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

      My understanding was that it defined $$$b$$$ as a subsequence of strictly increasing elements of $$$a$$$ such that they are all in the range $$$[0, n - 1]$$$. This is entirely consistent with the statement you highlighted. In other words, I interpreted it as a restriction on what constitutes a valid subsequence for this problem as opposed to redefining subsequence.

      The definition of beauty referred to $$$a_{b_p}$$$ and $$$a_{b_{p + 1}}$$$, so restricting $$$b$$$ as being a subsequence with values in range $$$[0, n - 1]$$$ was perfectly justified. There was nothing in the problem statement that hinted that my interpretation was flawed. My interpretation was a perfectly valid problem that I would probably have written in the exact same way as this given problem statement, but it was not actually the interpretation that was intended.

      What would have been correct is if, instead of "a subsequence of length $$$m$$$ of the array $$$a$$$", they wrote "a subsequence of length $$$m$$$ of the indices in array $$$a$$$.

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

        I see, i get your interpretation is that array B is :

        • Subsequence of array A (using the usual definition)
        • Increasing
        • Value [0, n - 1].

        But actually the sentence i highlighted mean array B, with property increasing and value between [0, n - 1] is the definition of subsequence, nothing else.

        Anyway now we know the problem, lets upsolve it! :D

»
19 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

I wasted more than half an hour on D1 because of the problem statement. Still don't get how a subsequence of 'a' implies a collection of indexes rather than the elements themselves.

»
19 месяцев назад, # |
Rev. 4   Проголосовать: нравится +6 Проголосовать: не нравится

Why the output in E is always either 1 or 2 if number of distinct elements in the input is greater than k? Any way to prove that?

  • »
    »
    19 месяцев назад, # ^ |
    Rev. 3   Проголосовать: нравится +61 Проголосовать: не нравится

    Off the top of my head.

    You can increase length of the first square in top-left (red square) until increasing it one more time reduces the number of distinct values below $$$k$$$ (green square). Then as the second square, you can take the blue one and increase its length until you reach the requirement. As the blue square reduces the number of distinct values by at most $$$2$$$, you might be off by one. But you can choose to write a completely new value or an existing value in the square depending on the situation you're in, so you can meet the requirement.

  • »
    »
    19 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +27 Проголосовать: не нравится

    You want to choose 2 squares such that by removing these squares, you remove all but $$$k$$$ or $$$k - 1$$$ colors from the grid.

    Consider for each $$$\ell$$$ the square that has the top left corner at the top left corner of the grid. Each of these squares removes at least as many colors as the previous one. The first square removes 0 or 1 colors and the last square removes all colors. If one of these squares removes exactly the correct amount of colors, we are done.

    Otherwise, there must be a point where the $$$\ell$$$-th square removes too few colors and the $$$\ell + 1$$$-st square removes too many colors. Now you can make all of those shapes with 2 squares:

    At each step you remove at most 2 more colors and transition from the $$$\ell$$$-th square to the $$$\ell + 1$$$-st square, so at some point exactly $$$k$$$ or $$$k - 1$$$ colors are left after removing.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

looks like if you use division on A it will FST

»
19 месяцев назад, # |
  Проголосовать: нравится +38 Проголосовать: не нравится
»
19 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

weak pretest for problem A.

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

Solve A in 10min — As problem A, not good enough.

Get FST — Good job.

»
19 месяцев назад, # |
  Проголосовать: нравится +22 Проголосовать: не нравится

About D's statement:

Obviously, neither "b is a subsequence of [0, 1,... n — 1]" nor "b is a subsequence of indexes of a" is way more precise than "b is a subsequence of length m of the array a". So why does someone writes things like "b is a subsequence of a" in the statement and don't make any public clarification?

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +4 Проголосовать: не нравится

    You pointed it out and yet they didn't bother updating the statement? Wow.

»
19 месяцев назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Confusing sample descriptions+weak system tests, gonna have a lot of fun losing 100+ points

»
19 месяцев назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

I don't think the description of problem D is reasonable. It writes that array $$$b=[b_0,b_1,b_2,...,b_{m-1}]$$$ is a subsequence of the array a. However, according to the exapmle, we can find that the elements in array b are indices but not elements in array a, which means array b isn't a subsequence of array a. To be honest, this bothered me a lot during the contest.(╥_╥)

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

Sad view don't open it

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

TeaTime could you update link to contest? Now it refers to 804 contest blog

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

168821144

Problem B, why this submission is TLE. Java

»
19 месяцев назад, # |
Rev. 2   Проголосовать: нравится -16 Проголосовать: не нравится

this is my first time commenting in CF discussion section this is my code for div 2 C Corners... but I got a fail on pretest 2. I tried debugging and solving but wasn't able to do it.

below i have also explained my code... if you can have a look. And tell me what's wrong with it. thanks

. . . . .

from collections import defaultdict

def solve(): t = int(input())

while t:
    t-=1
    R, C = [*map(int, input().split())]
    grid = [ [ 0 for i in range(C) ] for _ in range(R) ]
    count,zero  = 0, []
    # taking string as input and putting them in grid
    for r in range(R):
        temp = input()
        j = 0
        for c in temp:
            grid[r][j] = int(c)
            if c == "1":
                count  += 1
            else:
                zero.append([r,j])
            j+=1
    # if count of 1 == 0 printo 0. if count == R*C print (R*C -2)
    if count == 0:
        print("0")
    elif count == (R*C):
        print((R*C)-2)
    # else there are some zero in the matrix 
    else:
        # directions are to check if we can make a L shape that contains all 0's
        #   D1: |     D2:   |         D3: 0--        D4: --0 
        #       0--       --0             |                |
        dir1 = [ [0,1], [-1,0] ]  
        dir2 = [ [0,-1], [-1,0]]
        dir3 = [ [0,1], [1,0] ]
        dir4 = [ [0,-1], [1,0] ]
        temp = 0 # to count maximum Zeros in L shape

        for i,j in zero:  # list contains x-y co-ordiate of Zero 
            p = 0
            for dx, dy in dir1:
                if 0 <= i+dx < R  and 0 <= j+dy < C:
                    if grid[i+dx][j+dy] == 0:
                        p += 1

            temp = max(p,temp) # temp to store max number of Zeros
            if temp == 2: # if we get a L shaped Zero we terminate
                break

            p = 0
            for dx, dy in dir2:
                if 0 <= i+dx < R  and 0 <= j+dy < C:
                    if grid[i+dx][j+dy] == 0:
                        p += 1

            temp = max(p,temp) # temp to store max number of Zeros
            if temp == 2: # if we get a L shaped Zero we terminate
                break
            p = 0
            for dx, dy in dir3:
                if 0 <= i+dx < R  and 0 <= j+dy < C:
                    if grid[i+dx][j+dy] == 0:
                        p += 1

            temp = max(p,temp) # temp to store max number of Zeros
            if temp == 2: # if we get a L shaped Zero we terminate
                break

            p = 0
            for dx, dy in dir4:
                if 0 <= i+dx < R  and 0 <= j+dy < C:
                    if grid[i+dx][j+dy] == 0:
                        p += 1

            temp = max(p,temp) # temp to store max number of Zeros
            if temp == 2: # if we get a L shaped Zero we terminate
                break

        if temp == 0:  # there are no Two zero Adjacent so maximum move will be count - 1
            print(count-1)
        else:    
            # if temp is 1 it means two 0 are neighbors so we perform (Number of 1 in input) i.e count operation
            # if temp is 2 it means L shape is found. so we perform (Number of 1 in input) i.e count operation
            print(count)

solve()

»
19 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

B has more accepted solutions than A::) ...Weak Test cases but still, IMO it was a good question.

»
19 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

The editorial link is broken, says i'm not allowed to see the editorial

»
19 месяцев назад, # |
Rev. 2   Проголосовать: нравится +39 Проголосовать: не нравится

Amazing. We have successfully made two LGM's massively overcomplicate a Div. 2B. Um_nik: 168820726 jiangly: 168847264

»
19 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Can someone explain why my solution that just check for each i(0 ... 200) the last 3 indexes they were met in the array gives AC? I think the tests are just weak but maybe it can be proven in some way. 168854584

  • »
    »
    19 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +14 Проголосовать: не нравится

    Indices will grow larger than the elements themselves, and after every 256 elements, 8-bit will flip, and all previous elements are invalidated, because the most significant bits of new indices will be larger than any previous indices. Since a_i <= 200, they won't be affected by xor. So probably weak tests.

»
19 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Editorial is not opening!!!!!!!!!!

»
19 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

ABC=500,500,500

»
19 месяцев назад, # |
  Проголосовать: нравится -13 Проголосовать: не нравится

Problem A: why does this code 168868045 gives me wrong answer in 13 with GNU C++20 (64)

while the exact same code gives me accepted with GNU C++14 168869739

not my fault i guess !!

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    Because you are calculating with floating-point numbers, and they're different in 32-bit and 64-bit systems.

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

      how could i know ?

      • »
        »
        »
        »
        19 месяцев назад, # ^ |
          Проголосовать: нравится +33 Проголосовать: не нравится

        The better lesson to take away from it is to never trust floats. Don't use floats unless you absolutely need to. And even then be very careful with them.

        It's pretty rare on CF to need to use floats, especially on easy problems. There's no need to use floats in this problem, for example the fractions are equal if and only if $$$ad = bc$$$.

»
19 месяцев назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Ratings updated preliminarily. We will remove cheaters and update the ratings again soon!

»
19 месяцев назад, # |
  Проголосовать: нравится +18 Проголосовать: не нравится

In problem D1 there is no test, where the answer is 1.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

For the first time, I was able to solve 4 problems in a div 2 contest :)

»
19 месяцев назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

In Problem C, based on the constraints, I first came up with a Greedy Set-based NlogN solution, and without looking for any observations, decided to start implementing it, only to narrowly get TLE on TC 8 (even after multiple failed attempts at optimization).
I think the unusual Time Constraint of 1 second was a deliberate thing to prevent these kinds of solutions from passing.
While I agree that the intended solution is a lot more simpler and elegant, because of only a slightly higher time complexity, and because it required a lot more effort, the authors should have also allowed the greedy NLogN solutions to pass.

My Submission

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

My feedback (only ABC problems):

Good first three problems, especially B. I liked A too, but I don't understand why it got so few solves. C felt little easier that normal Div.2 C problem.

»
19 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

GreedyForces (?) It was a nice round, thanks!

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

I like this round, problem D was really interesting! Although the description was a bit confusing.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

You missed the part note the unusual time

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hello, the system says that I cheat on C but I don't what should I do? somebody help plz

»
19 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Attention!

Your solution 168861333 for the problem 1720A significantly coincides with solutions saubhagyaprakash/168825261, ajis207/168825753, Raaghav909/168833485, gla_191550059/168835636, akm1002/168836385, 6615-Bhumeera/168858644, MARSHALMATHERS/168861333. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

This has happened because problem A of DIV2 rounds is trivial most of the times and the code is of 4-5 lines so it is just a coincidence that someone wrote a similar thing which I did even if you would go through a number of other submissions you would find that the logic is nearly same and since it is a small code it gets matching for a number of people.

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

    I agree. I've recieved similar mail, someone's code is very similar to mine. (168808729, 168826905)

    Looking at the skipped submissions of 1720A, the codes are all quite similar. It seems necessary to re-check the skipped submissions.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

i got mails regarding coinciding codes in two accounts but actually both the accounts are mine ebshu21 and rony19 both are my accounts and i submitted the solutions for the contest problems during the contest from both my accounts but now that contest is not rated for me i my rating got reduced. please help me out. i can give all sorts of proof