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

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

Привет! В 15.01.2024 17:35 (Московское время) начнётся Codeforces Round 920 (Div. 3) — очередной Codeforces раунд для третьего дивизиона.

Раунд скоординирован Vladosiya, и подготовлен мной и студентами Neapolis University Pafos: Vitaly503, goncharovmike, ikrpprppp, step_by_step.

Большое спасибо Alexdat2000, dan_dolmatov, fastmath, FBI, Nickir, nikhil97agra, pavlekn, PMiguelez, SashaT9, senjougaharin, Sergey140146659, Sparrow_Guo, Toy_mouse, vladmart за тестирование раунда.

Как обычно для раундов третьего дивизиона:

  • в раунде будет 6-8 задач
  • длительность раунда 2 часа 15 минут
  • раунд проходит по правилам ICPC, штраф за неверную попытку 10 минут
  • раунд рейтинговый для участников с рейтингами до 1600
  • после раунда будет 12-часовая фаза открытых взломов

Напоминаем, что в таблицу официальных результатов попадут только достоверные участники третьего дивизиона. Как написано по ссылке — это вынужденная мера для борьбы с неспортивным поведением. Для квалификации в качестве достоверного участника третьего дивизиона надо:

  • принять участие не менее чем в пяти рейтинговых раундах (и решить в каждом из них хотя бы одну задачу)
  • не иметь в рейтинге точку 1900 или выше.

Независимо от того являетесь вы достоверными участниками третьего дивизиона или нет, если ваш рейтинг менее 1600, то раунд для вас будет рейтинговым.

Всем удачи!

UPD: Разбор

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

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

Can't wait to pass 1500

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

Wow! Translation into Russian

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

Good news!

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

Надеюсь снова вернуть ученика после этого раунда

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

As a tester, I fucked up during previous contests because I was poisoned( but I wont give up and will restore my CM status.

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

Am I right that round was rescheduled from 16th of January ? If so, its very unusual. For me I was planning to take part and made some effort to free 2 hours on Jan 16, but tomorrow it will be impossible... Or I just had a glitch about 16 ? )

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

Yet another post-contest discussion stream Upd: I have updated the link. Sorry for issues in the begining.

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

Finally my turn to write this...

My first unrated div 3

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

I hope to reach pupil rank one day :).

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

hoping for +ve delta in this round.

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

This comment has been deleted.

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

My first unrated div 3

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

i wish get 1400

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

Why is it rated for experts (1600) as well?

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

Good morning pashka <3

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

In the points it is written rated upto 1600 and then in the last it is written less than 1600.. which is true?

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

pashka кандайсыз?

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

I usually skip div3 these days, but I'll do this one just because of pashka :)

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

    Me too ^_~

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

    but "do not have a point of 1900 or higher in the rating."

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

      You can alwayes participate as unofficial participant

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

        with a rating higher then 1600 you can't register(I think)

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

          I have already registered and participated, and there are alot of div1 people doing the same thing (the only diffrence is it's unrated for us)

          The top10 in scoreboard during the contest had only 2 people that have rating less than 1600 and the most of the others are reds

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

Please restart your youtube channel with some new series, pashka orz

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

Any way to lower by rating by 12 ?

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

the round will be good if pashka prepared it)

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

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

Bunch of handsome peoples

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

can't wait

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

wow pashka here, I thought that we face a lot of interesting and educational problem

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

My first contest here :)

Got a question: a "penalty for an incorrect submission is 10 minutes" means that there is a timer and it takes 10 minutes away (so the round is 1h 5m for me), OR does it mean that I'm just banned from submitting code for the next 10 minutes, but I still have the same remaining time for solving problems.

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

    You get points like you submitted it 10 minutes later.

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

    No, that's not what they meant. You should be aware that if you got a accepted after(for example) two failed submission and someone got it from the first time (consider that both of u solved it at same time) he will get penalty less than u .Also,He rank higher than you.

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

If I have registered for the round but I do not enter the contest, will my rating get affected?

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

As non-tester i confirm this is the first Div.3 after new year!

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

All the best to all of you guys!
I want to reach exper in this round :)

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

Hopefully, the problem's statement will be short, precise, and easy to understand!

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

Great news, hope to get pupil....

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

Hope to pass 1200 today

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

My first unrated Div 3.

And pashka as one of the setters , can already confirm it's going to be an awesome coding contest!

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

anxiety

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

under 1600 is it unchange ?

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

Amazing round I love U all <3<3<3<3

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

Какие бархатные красавцы на фотке

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

As I write this round, I can say with confidence that it was a great round that I enjoyed.

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

Baby, I I I can`t wait ! ! !

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

with all due respect, problem C is just kind of shit.

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

    Bruh, you solved upto F but couldn't solve C :/

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

      If there's no problem C, it's easy for me to solve all the problems. I can't understand the problem, maybe I'm poor in English.

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

    Why? Because of the problem’s statement? I don't see any problems and it's a good problem.

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

      Maybe the problem is hard to understand for a Chinese English speaker. I spent almost 60mins to try to understand it but failed.

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

time to attempt the first question only to get it wrong on pretest 2 and ragequit (my rating still gonna go up lmao)

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

    i had the same thing, try virtual contests, they bring less stress gl

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

    your profile picture reminded me of Sam Hogan. Good old days

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

      it is sam hogan we will never the days he actually posted sadly he disappeared but tbh i don't know why anyone would want to leave such a successfully channel

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

        Game development can be exhausting. Brackeys and Dani have also not uploaded anything for quite some time.

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

          Brackeys left and im pretty sure Dani also quit also sam went off to college but yeah game dev is just generally like that

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

is F solvable using Mo's?

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

How to solve E ?

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

is F solvable using Mo's?

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

    You can just precompute prefix sums for d <= sqrt(n), and for d > sqrt(n) just brute force the answer. In the first case a query takes O(1) and in the second case its O(sqrt(n)). Preprocessing takes O(n sqrt(n)).

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

      I thought about prefix sum for small d as well but not yet implemented, tks for the clear solution!

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

      I thought of precomputing the prefix sums but just not for d <= sqrt(n), I was thinking of every d <n. Is sqrt(n) common in these type of problems? Why do we select that as the cutoff?

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

        it's very common indeed. U can read this for more detail

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

        Because memory is limited and if $$$d > sqrt(n)$$$ then it's easier to just iterate instead of precomputing for every element.

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

        Imagine , if you take d as a cut-off , then final complexity will be n*d + q*n/d = n(d + q/d) , which will be minimised at d = sqrt(q).

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

        sqrt(n) observation not necessary. you can do offline query method. for all the queries put the s%d,d in some set. now for only these (start,difference) you need to precompute and this would be somewhat n*(q)^(1/2) Submission

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

      ah that's really clever

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

    Basic idea is precomputing answers for all d <= $$$\sqrt{N}$$$, which can be done by prefix sums in O(N*$$$\sqrt{N}$$$). For d > $$$\sqrt{N}$$$, simply iterate and get your answer.

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

Nice contest. F and diagonal prefixes in G are tricky, nice problems for educational rounds.

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

nice round especially providing many sample test cases thank you

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

Exposing cheating case please make the contest unrated the solutions were live streamed on the following channel

https://www.youtube.com/live/q5YxSQlknAQ?si=rM_nl9XokelPGkJF

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

Got Stucked in Problem E.

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

Thousands of cheaters in this round. saw some noob coders solving DE faster than specialists. hoping they will get filtered out for fair rating update

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

In problem E what do they mean by if both opponents play optimally , do we have to check every possible move from current position, and move only in those direction in which player is winning?? i am not able to understand this problem please explain. Thanks!!

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

    play optimally means that if there is a winnig state for player A, then player A will play in such a way that will win.

    No need to check every possible move if you find a general case for wich A wins

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

Nice contest

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

I can't see myself in the standings. I have participated in 5 rounds and have solved at least 1 problem in each.

  • Round 919
  • Good Bye 2023
  • Round 916
  • Round 915
  • Round 914
»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I tried to come up with a one-line formula for B, but this approach gives WA in the 3rd test:

max(((s & f) ^ s).count(), ((s & f) ^ f).count())

Does anyone have any idea what I might be missing here?

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

    #define bin bitset<64>

    Your bitsets only store $$$64$$$ bits, not enough for $$$10^5$$$ bits.

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

      Oh my, haha! I got used to putting 64 bits everywhere and being sure it works for any input. I completely forgot I'm dealing with a bitset, not an integer or anything else.

      Thank you. It's accepted now! <3

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

mind solved f in 10 minutes, could not debug my code in contest with more than an hour left. then debugged within 5 minutes after the contest!!!!!

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

    can you explain your approach for the problem F ?

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

      2 cases case 1: when d>sqrt(n) in this case you can just brute force each query because will take O(sqrt(n)) time because if d>sqrt(n) there will be no more than O(sqrt(n)) elements to choose from i.e., k cannot be greater than O(sqrt(n))

      case 2: when d<=sqrt(n)

      for each element in i store prefix sums and for each d and also store increasing prefix sums (1*arr[i], 2*arr[i].. like this) then solve in O(1) per query.

      i did not explain case 2 very clearly i am finding it very hard to explain.

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

        got it , thanks

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

        for case 2 I'll explain how to solve when d=1

        given an array a, answer queries of given [l,r) find S = a[l]*1+a[l+1]*2+...+a[r-1]*(r-l)

        define sum[l..r) = a[l]+a[l+1]+...+a[r-1] = pref_sum[r] — pref_sum[l]

        notice S = sum[l..r) + sum[l+1..r) + .. + sum[r-1..r) = (r-l)*pref_sum[r] — pref_sum[l] — pref_sum[l+1]-...-pref_sum[r-1]

        so we can do a second prefix sum array over our original prefix sum array

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

        i did not explain case 2 very clearly i am finding it very hard to explain.

        I seriously think this is the reason why you couldn't debug your code within an hour. It may make sense to explain your solution to yourself until you understand all the details completely before implementing it

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

          Or understand during the implementation. Sometimes it's nice to write down something to free up some space for understanding missing bits.

          ps. Congrats with impressive performance in the round.

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

          ya i think so to, i jumped into implementation too soon.

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

Hello, CodeForces!

I am aware of the fact that my observation might be slightly necroposting, but you forgot to thank Mike Mirzayanov for the great Polygon and CodeForces platforms!

Have a pleasant day!

Cristofor

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

I don't know why, but I do very well outside the contests but when I participate I feel stupid, I didn't even solve D.

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

    Same lol :)

    I kept tripping over the math for B and C.

    Then for D, I was thinking it was a heap/priority queue solution, but I couldn't figure it out.

    Was hoping to make Pupil this round, but oh well :_(

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

    just need to participate in as many contests as you can

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

      well you are wrong here is why.... but jokes asides its like you tell someone to play more blitz games to get better at chess

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

        uhm but it's not about getting better at something what he/she is asking, it's about getting used to something so you can overcome nerves

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

    I found that D is extremely likely to be fakesolved for me. I cannot find the bug since my code pass all examples and got WA on test 2.

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

      I don't think so man, I passed all example cases through different approaches but two of them were wrong and then the third one finally got me AC.

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

Another fun round for a newbie like me :) Please somebody should try to hack my solutions

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

I am an amateur I have just solved one problem I just want to ask can I have some score? I hope I will have 1200 through this vacation's effort Can someone explain to me how can I get some score

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

    With 1 solve and your default expected performance being 1400 you should expect a huge drop in rating. However since you're unrated, there's a +500 bonus on the first round, so your rating will still increase.

    You would need to wait for the system test to end, which would happen about 18 hours from now, since there is open hacking phase.

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

    Do continue practice. It will improve your problem solving skills and logic building skills. I am also a amateur coder .But now i taking it seriously I was able to solve two problems. Earlier i was not able solve any problem. But with continuous practice i have some improve skills

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

Such a nice contest! really liked the F. overall quality was great and the contest was balanced , 10/10 honestly.

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

how to solve F and G??

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

    F can be solved in O((n+q)*sqrt(n)) , by dividing in two cases d <= sqrt(n) {for which you can use suffix sums) and d > sqrt(n) for which just sum directly. However , I believe taking d <= sqrt(q) , will be more better.

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

Too many cases in E, solved just after contest ended :(

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

    you can just simulate it !

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

      constraints are large. can't simulate it.

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

        "It is guaranteed that the sum of $$$h$$$ over all test cases does not exceed $$$10^6$$$."

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

          sorry my bad, didn't see. I just saw the constraints of w and assumed h to be similar :(

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

        I think it can be simulated as the sum of h over all testcases is guaranteed to not exceed 1e6

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

        Just few cases :

        if d = vertical distance between them is odd or even ,

        If d is odd then Alice will Eat B or B will escape ,

        If d i seven then Bob will Eat Alice or Alice will escape.

        Escape condition needs max right you can go and max left you can go, if by going to any extrema ( left or right ) , if you are able to escape the Eater, then draw or else lose.

        Link to code

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

    Single if is enough to compare two intervals where two players could meet.

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

Naisu contest, I felt climaxed by the AC in the final seconds =))

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

Sqrt contest)

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

can someone give me clean implementation of F?

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

How to solve G?

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

    Make diagonal prefix sums, like 2d prefix sum and try each of 4 possible directions in O(1) for n*m shooting squares.

    I failed to implement it in time

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

    Bruteforce every possible starting location. To move the starting position by one cell you need to add/remove subsegments of a row, column, or diagonal. From here it's down to your implementation skills.

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

    There is a simple solution in $$$O(nm*min(n,m))$$$.

    Assume WLOG $$$n \le m$$$, The solution is: iterate over every $$$(i,j)$$$ as the start location, iterate over every row $$$x$$$ that the $$$(i,j)$$$ will reach with the operation, find the sum of the elements of the row that is in the range of the operation with simple prefix sum.

    This work in O(n^2 m), if $$$m < n$$$, just rotate the input. This is code: submission

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

      Oh, I thought this will TLE, but min(n,m) can be at most sqrt(1e5), which idk why, I missed :(

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

    I had a slightly different solution:

    Solve the problem for the down/right diagonal only. Rotate the grid four times and print the best answer over each rotation.

    To solve for the down/right diagonal, notice that a shot from point (r, c) of size k is equivalent to a shot from point (0, 0) of size k + r + c, minus the combined number of targets in the first r-1 rows of that shot and the number of targets in the first c-1 columns of that shot. This can be found using inclusion/exclusion and prefix sums.

    So, we can enumerate the targets in order of their Manhattan distance from (0, 0) and check starting points for the shot using a sliding window technique.

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

Problem D  In some test cases, t is 10000 (which is not correct)

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

    Yes, we will fix it and rejudge all affected submissions.

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

      Done. We changed the tests so they have at most 100 testcases. It affected a very small number of participants. They got AC instead of TL or WA.

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

Can anyone tell me why my solution of D is giving me wrong answer on test case 3

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

Good Round

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

Nice F, btw this is the worst E i have ever seen in div 3 lmfao

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

Hi, Can somebody explain why this Code for Problem D gives Runtime Error 241826844.

  • »
    »
    4 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    prefa[0] = a[0];
        for(int i=1;i<m;i++){
            prefa[i] = prefa[i-1] + a[i];
        }
    

    this segment will cause Index Out of Bounds for Array "a"

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

Nice F, btw this is the worst E i have ever seen in div 3

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

F-ed Up big time. Submitted E just after the contest ended and got Accepted on the first attempt. FML :').

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

Can today's D be solved by binary search?

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

    my approach was to club max elements of A with min elements of B and Max elements of B with min elements of A.

    And there will always exist an index i before with we'll club max elements of B with min elements of A and after index i we'll club max elements of A with min elements B

    I brute forced it. It gave tle on tc7

    Now i want to ask that if this can be optimized using BS. BS to find that optimal index i?

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

      Binary search is only applicable for monotonic functions, in this case, the function isn't monotonous. So binary search won't work

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

      Brute forcing like that is how I did it, you can optimize by using prefix sums to calculate the answer for each cut-off point in O(1).

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

I have solved all the problems except the last one. I am willing to discuss the solutions with you. If you need help for the hints or solution idea, you can knock me.

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

Just curious, is D solvable using ternary search?

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

    my thought process included noticing the ternary searchable array. But since we're trying to maximise the answer, optimal points will be on either left or right ends.Therefore no need to do ternary search. just have to check ends

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

How many problems I need to solve in Div3 as a pupil, to reach specialist ? Can someone tell ?

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

    Want to know the same

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

      i think solving 4 fast is pretty good to reach specialist. In some cases if E is easy then solve that too.

      (take advice with grain of salt I am newbie)

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

    I did some calculations and i figured that if u managed to solve A and B in div 2 under 15 min u might reach specialist without ever solving C or rarely solving it. Similarly solving 4 in 45 to 50 min will get you to specialist through div 3.

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

Can anyone tell me what the time complexity of my code(Problem G) is? 241841658

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

In F, I am trying to solve this question O(n*root(n)) but it is giving me TLE. I saw many people did it in O(n*root(n)). can anybody help me to find out where I am going wrong? My submission: [241845077]

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

In F, I am trying to solve this question O(n*root(n)) but it is giving me TLE. I saw many people did it in O(n*root(n)). can anybody help me to find out where I am going wrong? My submission: [241845077]

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

    Yeah, your solution is O(n*root(n)), but your index in vector is [arr_index][step]. If you know, vector stored continuously in memory. When you refer to [ind1][step] you need calculate offset to [ind1][0]. If say simply, need to calculate [0].size() + [1].size() + [ind1-1].size() and it's not effective. But if you start iterate by first index and after by second index it's more faster, because your elements in memory was close. You can turn your vector and get accepted 241873500. Or you can use matrix, because program know size of every lines. 241875600

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

Hi, I am new to codeforces. I submitted a code 10 minutes before the contest ended and it was accepted after 3 failed attempts , why is it still showing as unrated for me? And when will I get it get rated for me. Someone plz reply

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

Hello everyone. For D i used the 2 pointer approach to solve it. Basically sorting both the array then checking for each term in nth size array which difference is the maximum. Depending on the term chosen, the pointer moves and rechecks.

You can see my submission. I have gotten a test case where the solution fails. But i am not sure what is wrong with my approach. One of my friends used the same approach but deque and got the correct result. Any help would be appreciated.

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

Who else say E and thought: "oh yeah this is like opposition in chess endgames"

lol

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

My D's solution got WA on tc2 when submitted during contest. After System test it got AC. Now after System test again it got WA on tc24 .

What's the issue here? I meant on CF site, why did it happen?

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

关机不耗电

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

241860369

Problem E.

Easy to understand one liner solution C++.

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

take part in at least five rated rounds (and solve at least one problem in each of them)

Hi, does this apply to all Div.3 contests? thanks

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

I love this round from A-F(I didn't read G), except for E.

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

How much time will it take for the ranks to be updated?

Hope I reach pupil :)

And also can anyone explain what are 'hacks'?

  • »
    »
    4 месяца назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    • The rating update process typically takes approximately 1 to 24 hours.
    • Hacks refer to a method where contestants can view each other's solutions for a given question. Assuming a solution passes all test cases, hacking involves suggesting a test case that would cause the solution to fail. In Division 3, there are no rewards for hacks, and the hacking period lasts for 12 hours after the contest concludes. In Division 1-2, participants receive points for successful hacks, and they must actively hack other solutions during the contest.
  • »
    »
    4 месяца назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    Hacking means finding bugs/testcases in other people's solutions that make the code fail.

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

Overall, Another fun round for me :)

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

when the ratings will get upated?

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

When will you release the editorial?

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

when will the rating change happen?

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

When will the ratings for this round be updated

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

    within 24 hrs after contest.

    Can you say how many problems have to be solved in div3 to become pupil?

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

      Bro got no chill to become a pupil.

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

        how many did u solve?

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

          I did 4 questions. D was hard for me.

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

            I did 3, I considered two pointer for D, implemented it also and it was not giving correct answer for tc1.So left it.

            after the contest i came to know that there was some issue with my implementation though the approach was right. T_T

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

russian shephard

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

Has system testing finished??

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

    Yeah. System Testing takes less than 30min after the hacking period concludes. You can go to "contests" in the navigation bar and see the final standings.

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

      Nooo

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

        Sorry. I was wrong. This is what I found- "It takes a while (can be a few hours, or even more) to finalize things such as detecting cheats and confirming test results, or there can be other issues that need investigation"

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

Why is the rating for this round not updated yet?

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

Ratings?

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

    Ratings take up to 24 hours to update in div 3 and div4. Also in a contest that has an official 12 hour hacking phase the rating will never be updated before it ends.

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

Why didn't I add a rating to this competition (my current rating is over 900)?

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

Can't wait to become PUPIL

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

Rating kab update hogi ? Koi batado ! Baar baar dekh dekh ke pareshan hogya

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

A,B failed in system tests... :)

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

thank you for making me green

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

Please, help me to understand problem )

This submission gives TL on test #12: 241773908
If I change only language (java 17 instead of java 8), the same solution gets AC: 241948448

I can't understand, why the same solution gets TL and AC on different java versions?

Thanks

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

    I think the problem here is that sorting in Java 8 has $$$O(n^2)$$$ worst case time complexity. They fixed it in later versions

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

This round Problem F have nearly same idea with recent atcoder abc contest 335 problem F. Problem link : https://atcoder.jp/contests/abc335/tasks/abc335_f

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

When will the results be declared?

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

F Video editorial + Live Coding C++ (English): https://youtu.be/mJVq_nW8iQk

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

F Video editorial + Live Coding C++ (English): https://youtu.be/mJVq_nW8iQk

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

why my rating got reduced by 30+ points even though I did no wrong submission just only one submission I did why on the earth soes this hpnd?

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

    You did one task and in the result you got 20596th place, which is lower than "expected" for your rating. Also note that wrong submissions don't affect your rating directly, only the score obtained during the competition, which translates into your place in the standings.

    more info

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

Problem D is 1100 rated 😱 😱