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

Автор mainyutin, история, 6 недель назад, По-русски

Привет! В 08.04.2024 17:35 (Московское время) начнётся Codeforces Round 938 (Div. 3) — очередной Codeforces раунд для третьего дивизиона. В этом раунде будет 6-8 задач, которые подобраны по сложности так, чтобы составить интересное соревнование для участников с рейтингами до 1600. Однако все желающие, чей рейтинг 1600 и выше могут зарегистрироваться на раунд вне конкурса.

Раунд пройдет по правилам образовательных раундов. Таким образом, во время раунда задачи будут тестироваться на предварительных тестах, а после раунда будет 12-ти часовая фаза открытых взломов. Мы постарались сделать приличные тесты — так же как и вы, мы будем расстроены, если у многих будут падать решения после окончания контеста.

Вам будет предложено 6-8 задач и 2 часа 15 минут на их решение.

Штраф за неверную попытку в этом раунде будет равняться 10 минутам.

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

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

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

Задачи были придуманы и написаны нашей командой: mainyutin, vmanosin7, ssor96 и ZergTricky.

Также большое спасибо:

  1. Vladosiya за помощь с идеями и прекрасную координацию раунда;

  2. FairyWinx, sevlll777 за красное тестирование раунда;

  3. ace5, Nickir, senjougaharin, vladmart за жёлтое тестирование раунда;

  4. natalina за синее тестирование раунда;

  5. bitthal04 за бирюзовое тестирование раунда;

  6. Alequisk, Mohamed_Hesham за зелёное тестирование раунда;

  7. MikeMirzayanov за системы Polygon и Codeforces.

Всем удачи!

UPD: В задаче G была допущена ошибка с валидацией взломов, но сейчас она уже исправлена. Все успешные взломы будут перетестированы. Ошибка не затронула претесты, они не будут изменены.

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

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

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

yay div 3!!!

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

    do just rating++)

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

    spoiler hopefully i get 1200

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

      i am new here , i participated in this round and my current rating is around 800 , but now this contest is showing as unrated on my profile . i dont get it , it clearly says -"Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you."

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

authors pic??

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

No pics with pizza.

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

Experts be like: I'm out of competition (つ▀¯▀ )つ

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

Дождались!

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

I appreciate the creators' effort on this div.

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

Is that a gan cube :o

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

Let this be the round where i shall become Pupil under the Heavens .

It's divine Conviction that i shall fulfil.

In the name of all mighty Behelet behold my Pupil Rank

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

Good luck to everyone! I'll sadly have school but I'll find a way to participate since cf >>>>>>>> school

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

i think it's time to give it a try to change my color

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

Very Saaaaaaaaad
I am not participating :(

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

Hope to be pupil after this contest

Good Luck!!!!!

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

    i am new here , i participated in this round and my current rating is around 800 , but now this contest is showing as unrated on my profile . i dont get it , it clearly says -"Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you." , can you please explain what am i missing.

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

Hope to be specialist after this contest

Good luck to everyone!

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

Authors' photos again!

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

Hope I can get back to my real rank of pupil

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

hi everyone, mwah. i love yall. happy contest day! wish you good luck. mwah. (please downvote me)

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

should i participate or nah?

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

OMG! Another mainyutin round ...

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

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

Back to Expert

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

    Bro did a manifestation

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

      lmao

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

      Bhai it's IQ 69. If you have a bad performance in div2 and you are becoming a specialist from Expert and the next contest is div3. Let the rating fall. At least div 3 will be rated.

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

Why ppl are lately participating comparitively less in contests? I remember seeing 40k registered_participants and 30k actually_participants! (not a long ago) But nowadays it's hardly 20k ppl

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

    Well I bet some people had spring break last week, this week they're back to school.

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

Queue is too big.

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

queuedforces :noo:

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

long queue

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

The site is unusable for today's round,i have been waiting for 10 min to submit,it keeps loading.

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

I am sorry but The queue is too annoying today.

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

    then just switch to another problem

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

      That doesn't affect the fact that the queue was still too long

      Also being able to get feedback that your answer is correct/wrong in a short amount of time is important in a format where speed is necessary, since it overpenalizes answers that fail the tests since you could be working on a different problem only to return to see that you WA'd on the problem you left

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

hope rated

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

this comment is in queue

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

For once, I won't believe that my poorly optimized G could survive, so guys, please hack my G submissions till TLE XD

Nice contest overall. I was infuriated by H at first since I skipped a crucial line in the statement, yet after that the problem was really nice, huge kudos to its setter.

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

    My inexperienced self tried pretty hard, but sadly could not even get close. :(

    Actually, isn't the worst case a highly composite number like $$$720720$$$ or $$$360360$$$? Then how did it get so close to TL (your solution passed my worst case test in about 1.5 seconds)?

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

      Honestly I couldn't think of anything better than what you just stated. This is weird.

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

        Maybe since a lot of numbers are the same in my testcase, the compiler magically optimizes stuff away? Or another reason might be that the server is slower during contests as opposed to during the hacking phase (I'm probably wrong about this one, if anyone knows about what difference there is, please enlighten me)?

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

          Your first theory actually made sense, since caching, in regular cases, could be considered a CPU trait, and that would help speeding up if your testcases are identical.

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

    Nice idea, I believe most of the time is wasted on (re-)allocation of visited, if you make it static I believe it would be a massive speed up.

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

      Just duct taped my code again and it actually worked: 255770022

      Thank you, another thing to remember for future implementations.

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

      how come there is such a big gap between this two implementation? (reallocation and looping reset visited) Isn't both operations O(n^2)?

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

nice problems

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

Ahh! I just figured out how to optimize my solution for E.

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

    same man just did D, uploaded the file and submitted with 40 secs left,the submit didnt even register somehow!

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

    can you explain your solution please

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

      Given the constraints of the problem statement, it suffices to code a solution that works in O(N^2) per test case. So, we can brute force over all n to find the largest possible k that can change the characters to 1's.

      How do we find out whether this can be done for some k?

      If s[i] is '0', then we must flip s[i...i+k-1]. From i=n-k to n-1, we can't create anymore flipping segments. Therefore, after performing some operations, we can check whether s[n-k...n-1] is only 1's. Iff so, then k works.

      Of course, flipping each s[i...i+k-1] is O(k), which is slow. Instead, find out how many times s[i] has been flipped. Let this be flips. This can be done using a deque D: whenever s[i] is '0', flip everything from i...i+k-1 (increment flips) and push i+k to D. If i is in D, decrease the current number of flips (decrement flips).

      For the remaining k values, check if s[i] = '1'. We follow a similar procedure as before. To check if s[i] is '1', check if flips is even or odd. If it is even, then s[i] did not change. Otherwise, it clearly changed. If i is in D, then decrement flips (as this was an endpoint like other flips).

      I hope this explanation makes sense.

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

RIP python users for F

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

    Why?

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

        Spoiler

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

          Tell other method pls

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

            Hint 1

            Hint 2

            Hint 3

            Solution

            Code

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

Can anyone please give a test case where my D solution will fail?

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

    How do you handle this case?

    1
    4 3 1
    9 9 9 1
    4 3 9
    
    Your code answer
    The right answer
»
5 недель назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Why is this giving a runtime error? My code works when I test it myself

Submission: 255757485

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

B is harder than F.

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

    I guess not, just do what is asked, nothing tricky is there.

    only need to be careful about the conditions that matrix you form should be consistent from every path you choose to build it from.

    update: corrected a typo

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

    Think out of the box and B would be really easy.

    Take the minimum element of $$$b$$$ is a new $$$a_{0,0}$$$, then construct $$$a$$$. Sort $$$a$$$ and $$$b$$$, and we'll now only need to check if two sorted lists are identical.

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

    Trying to compare B and F is so weird because they're so different since B is a "just code it" problem and F is a logic problem, but I definitely agree with this opinion since F is guess forcable and one of the integers isnt even that relevant (namely 4)

    If they increased the integer maximum to be 8 I'd think that would make it a reasonable F problem

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

I think F should come before D. He's too easy in that order!!!

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

    how to solve F, i have some idea, but was afraid of lot of case work solution so did not went ahead with my intuition

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

      int main() { int tc; scanf("%d", &tc); while(tc--) { int a0, a1, a2, a3; scanf("%d%d%d%d", &a0, &a1, &a2, &a3); int ans = a0/2 + a1/2 + a2/2 + a3/2 + (a0 % 2 & a1 % 2 & a2 % 2); printf("%d\n", ans); } }

      Check this solution.

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

      I just followed the instructions step by step 255749602 (Maybe I'll get hacked).

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

        you actually did what I was afraid of during contest, hats off.

        how to be confident when writing casework solution, How to let go of this fear what if i miss some condition...

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

          Apart from the computable parts (like time complexity) the rest is up to luck, I keep missing some condition which leads me to 8 WAs in C and E.

          I'm not sure if I've got the right answer. I can't prove that my solution is comprehensive anytime soon, I just pray that he is.

          Confidence is something that is affected in many ways, with Codeforces Round, just code what comes to mind, short time don't allow to think too much, you should think about the comprehensiveness of the solution at the end of the round.

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

      you can just do dp[201][201][201] for first 3 numbers and 4th number is independent so just add d/2 in answer.

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

Can someone explain why 255755491 gets TLE for problem D. It should be O(nlogn),right?

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

    Briefly reading your code, I see that you used multiset::count.

    However, a quick google search shows that:

    The time complexity of the multiset::count() function is O(K + log(N)), where K is the total count of integers of the value passed.

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

      That could be it. However, I submitted the same code(255759509) with C++20 and it passes now in 452 ms. UPDATE — Read the comment below

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

      Thanks for the help.multiset .count() was indeed the problem ,i replaced it with multiset.find() and it passes now. Code- 255761397

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

Video Solutions for all problems:

Video for A-D: Video for E-F: Video for G-H:

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

what a intresting problem H, sadely could not solve it,

can someone share the hints for it?

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

    First, lets try to solve an easier version of this problem:
    Ignore "However, each $$$r$$$ can only be used for at most one tower."

    Solution

    Going back to the main problem:

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

Is the intended solution for G not this: Brute for all factors of gcd(a[0][0], a[n-1][m-1])?

If it is, why is the TL so annoyingly tight?

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

    I also tried that and got absurdly close to TL. I even thought that I might have made some idiotic implementation error to have the execution time ramping up...

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

      Fr it was so annoying, I submitted G, confident that it passes, and started coding F. 5 mins later I go back and see, tle on 24 🤡. Then I do some changes, submit, come back and see tle 🤡 Then finally I get it too pass, but it takes close to 2900ms and will get hacked 🤡

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

    I was doing bfs using queue and for some reason it was taking a lot of time. Changing it to simple dfs made the runtime to only 296 ms. For your case however, i think your precomputation of factors is taking a lot of time.

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

    I think that is the intended solution — 255735337

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

    My $$$O(nm\log^2(A))$$$ solution uses 1/10th of TL

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

    My this solution passes in TL easily

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

contest shows how many problems with greed code that i can't write XD

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

Is this solution to G hackable. I stored all possible values of the gcd at cell $$$(i, j)$$$. I think it should work because there are at most $$$\log A$$$ values of the gcd on a path. Code:255759157

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

Can H be solved using maximum weight bipartite matching? I also used the observation that no tower would have $$$r > 20$$$, was this a wrong assumption?

Update: After looking at some other comments, I think I got the issue with my solution.

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

A nice competition!

I enjoy it!

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

https://codeforces.com/contest/1955/submission/255756584

could anyone tell a counter test case where this fails for D

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

Nice contest. Problems were good. Thanks for the round mainyutin vmanosin7 ssor96 ZergTricky and all testers.

Also, congrats Geothermal on back-to-back wins!

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

div 2.33

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

Was the statement for problem A silently modified during the contest? More specifically, was the word "exactly" added or did I just miss it.

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

    Dude I can swear there wasn't the word "exactly" when I first read it, maybe I just missed it...

    Also I was mistaken at the term "a promotion", I thought that it can only be used once, but turns out I can use it multiple times. Got 2 WA on problem A lol

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

      Seems like we just missed it... I checked a video and it did say exactly from the beginning. The only difference was that it wasnt bold.

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

Using a segtree on problem E be like

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

    What's the solution for problem E?

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

      Basically since $$$O(N^2)$$$ passes, you can test every possible $$$K$$$ from $$$N \rightarrow 1$$$ and return the first one that works. This step runs $$$O(N)$$$ times. The question is now: how do you check if operations of size $$$K$$$ can turn a string to all 1s?

      First, notice that since this is just an XOR these operations are both commutative, associative, and their own inverse. So there's no point in applying the same operation to the same substring more than once.

      With that, notice that if $$$s_0 = 0$$$, there is only 1 operation we can and must perform: invert {$$$s_0 ... s_{k-1}$$$}. Inductively, it is sufficient for us to apply the operation only when the first element in the operation is zero. This step runs also in $$$O(N)$$$, bringing our current total to $$$O(N^2)$$$.

      The final step is figuring out how we can apply the operation very quickly. If we prefer typing or templates to critical thinking and reasoning, we can just use a range update / point query data structure like a Segment Tree, Fenwick Tree, Sparse Table, etc. I did this in during the contest 255770625 and made sure to statically allocate my segment tree instead of using std::vector so I didn't get hacked. I also manually coded this because I enjoy a nice hand-crafted segment tree (brainrot).

      However, instead of that beautiful solution, we can do it intelligently by inverting in $$$O(1)$$$ on the fly by keeping track of whether or not we are inverting, and then setting a reminder $$$K$$$ indices ahead to remember to start un-inverting. I did this after the contest 255903468.

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

Can someone please tell why 255705783 gave wrong answer test 1, when I run it locally it gives me the correct output furthermore when I submitted the same code with c++17 it gave TLE test 3 which makes me think it's something around c++20 that I might not know ?

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

Problem G and H are enjoyable. Enjoyed how there was such a simple solution to G if you made the appropriate observation. And problem H was very interesting, I implemented a dp bitmask, but some reason still getting WA on test case 4. I think I may have small bug, but I think the approach is correct.

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

can someone please tell me why this 255705783 is WA test 1 when I run it locally it gives me the correct output, furthermore when I switch the compiler to c++17 it gives TLE test 3 this time, maybe it's smth abt c++20 that I don't know ?

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

255760248 Why does this submission exceed TL ? I think the complexity is $$$O(n\cdot(n\cdot \log n))$$$

I realise this is most probably not the intended solution. But if it helps to understand the submission, I have just tried to go over all possible $$$k$$$.
Used PBDS for calculating if a current position has been previously flipped an even or an odd number of times.
For each $$$k$$$, considering all previous operations that have modified a position, I have never flipped a position that is currently a $$$1$$$ and always flipped a position that is currently a $$$0$$$.

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

    IMO $$$\mathcal{O}(n^2 \log n)$$$ is a very dangerous complexity for $$$n = 5000$$$, and I would not gamble on it even with 3s TL.

    Used PBDS for calculating if a current position has been previously flipped an even or an odd number of times.

    You could actually improve this part by using a queue instead of a PBDS.

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

      My $$$\mathcal{O}(n^2 \log n)$$$ solution got AC and ran in under a second with Fenwick Tree. 255763784

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

      Thanks for answering. I was also guessing that PBDS is going to cause TLE even if $$$O(n^2 \log n)$$$ could have squeezed past the TL. Thanks for the queue insight too. I realised I know nothing about queues :)

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

        The only thing I could suspect is that PBDS is already a high-coefficient $$$\mathcal{O}(\log n)$$$.

        For the queue stuff, just imagine this assuming we're trying length $$$k$$$: store the starting points of all flipping segments in the queue, then when investigating index $$$i$$$, any starting indices up to $$$i-k$$$ has no value. Why a queue? We're iterating indices in ascending order, and added index would later be invalidated in that same order as well, which fits the FIFO nature of a queue.

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

          Yeah, makes much more sense now. Thanks a lot and welcome back to CF contests.

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

    I used PBDS for calculating if the current position has been previously flipped an even or odd number of times. Here's my submission.

    I later realized we insert indices in a monotonically increasing fashion in the data structure we maintain. So we can also use vector/queue. With vectors we can use lower_bound and with queue we can pop the indices that are at a distance k of far than current k.

    Vector solution: here Queue solution: here

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

      All submissions you've linked are in queue at the moment lol.
      But, yeah lesson learnt. Don't be lazy and use sets everytime you want a sorted list.

      I later realized we insert indices in a monotonically increasing fashion in the data structure we maintain

      Now that you have put it this way. Its baffling how obvious this was and yet I missed it.

      Want a sorted list. Want integer-positions. PBDS. TLE. Die.

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

        Yeah it was pretty obvious but even I wasn't able to come up during contest so I did it using ordered set. It was only after contest when I realized it can be accomplished using vector.

        And as AkiLotus mentioned, queue can be used to eliminate the logarithmic factor and achieve a linear solution.

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

can anyone explain the idea to solving D?

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

    Sliding window. Just check for every segment of length m if there are atleast k elements in that segment that are present in b. Count can be maintained using a map.

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

I failed to see the key observation that GCD must be a divisor of both top-left and bottom-right corners, so I ended up solving a more general version of the problem which finds maximum gcd for each path from top-left corner to cell (i,j). Tbh it was a good problem to practice some prime optimizations although it was not intended.

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

bro my computer crashed during the contest and my coding software was deleted (dunno why) and any custom invocation would take more than 7min (dunno why) so i just had to randomly code on the submission site ToT

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

    I usually use the one from AtCoder, it runs the code and gives the result faster than Codeforces most of the time.

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

    use online compiler like online GDB or other there are many options and they are fast

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

what's wrong with my c ? pls check[submission:255762443]

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

F should be in place of B didn't read it during contest

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

Extremely easy problem F!!!!! -_^

include

int main() { int tc; scanf("%d", &tc); while(tc--) { int a0, a1, a2, a3; scanf("%d%d%d%d", &a0, &a1, &a2, &a3); int ans = a0/2 + a1/2 + a2/2 + a3/2 + (a0 % 2 & a1 % 2 & a2 % 2); printf("%d\n", ans); } }

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

Spent half contest time to implement the simulation for problem C, couldn't make it but still a great experience.

Thank you guys for a nice contest!

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

I just realised problem G is but a simple BFS ToT

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

I have an ask for harder version of $$$G$$$ , same constraints , just your starting cell can be any cell inside the first row and finishing cell can be any of the last row , then how to solve it?

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

    How is that any different? Just run dfs from every cell in first row instead of first and check if any cell is visited in last row instead of only bottom right.

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

submission1 submission2 Here are the two submission can anyone tell me why they are giving different answer? The only difference is in the solve() function.

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

Problem G is the same as https://community.topcoder.com/stat?c=problem_statement&pm=16140&rd=18085. Of course, it's not as big of an issue as Div 3s are supposed to be educational anyway, but just putting this out here :D

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

Can binary search be applied in E to make TC roughly NlogN

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

Why using qsort (C/C++) in B can be easily caused by Quicksort hack halyavin.cpp to cause TLE (e.g. 255659588) ?

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

    It's the nature of quicksort algorithm itself to have $$$\mathcal{O}(n^2)$$$ worst case time complexity, thus as long as you know the sorting was a pure quicksort and you know how the pivot was chosen by the library, you could always counter it.

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

How to E

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

    bruteforce + greedy

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

      How to check if k is valid

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

        well you have to choose some subarrays of size $$$K$$$ to invert and subarrays do have a unique starting index and so you put inversion on an subarray starting from a particular idex at most $$$once$$$ so you start from the beginning , on your current index the value of the character in string is fixed so you can choose that index as starting point of a subarray or not(which is a certain choice), so if you do inversion the cost of that ends $$$K$$$ indexes later and if it's valid it will be at $$$\le n +1 $$$ and if valid you move on to the next index to check validity again otherwise invalid proved

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

Can anyone suggest a tc where this fails for problem D :(255769513

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

can anyone explain this solution to problem E? i fail to understand how we are checking if integer k is valid or not.

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

submission1 submission2 Why they are giving different answer? The only difference is in the solve() function only. Is this a CPP Bug or I missed anything? mainyutin

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

    It may not be a reason actually, but most likely it is because you are not clearing your dp after/at the start of the next testcase

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

Can anyone tell me why my code of problem C 255769305 is giving TLE on testcase 3. I thought deletion in deque is O(1).

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

    The time complexity of your code is O(min(s,k)), s = sum of durability of the ships. As s and k might be too large (k <= 10^15, for example), it would give TLE.

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

    your solution time complexity is min(sum of all the element, k) which in worst case can go upto 2e14 like your are just simulating the process which is not optimal

    required optimisation — in the while loop of q.size() and k

    take the min of q.front() and q.back() if 2*mn <=k do this {

    then reduce mn from front as well as back of deque then if q.front==0 do pop_front() and if q,back()==0 do pop_back()

    } else break;

    now if d.size() is greater than 0 check can we remove the first element (value should be <= (k+1)/2 if yes pop_front() do same for last element if it exist (<=(k/2))

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

I spent really a lot of time during the contest trying to make my E solution faster, even though it should have O($$${n^2}logn$$$) complexity, which is with n <= 5000 should pass the 3 second limit. The only thing that helped me was changing long long to int, but even so, it's still very slow. Does anyone have any idea why my E solution is so slow (below is the final one)? And a similar question is about D as well, because I can't see any clear reasons why it is so slow:

E: 255741981
D: 255675779

Edit: Sorry about how code in E looks like, I don't know why it shifted, because for me it was totally normal when I was sending it.

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

.

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

    I too felt the cheating happened in this contest a lot, my rank was around 160ish before 1 hour end of contest, and i could not solve anything further was only able to solve 5(A-D and G) but somehow so many other peoples solved problems that my rank went to 700+, i was thinking maximum i can slide is around 300-400 but 700+ did not feel organic... I might be wrong but this is what i feel.

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

      I feel like especially in the last 8-10 minutes, the spike of "AC'd" submissions shot up.

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

      Bro this is common if you cant solve good problems , you solve the easy questions fast it doesnt mean that the people below you cant solve the tough one faster than you that happens everytime , the people who have much more knowledge will eventually occupy the rank

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

pray for me to reach pupil ^_^

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

Great Contest!!! Very nicely framed

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

очень отличный контест, жалко на Д просидел весь контест потому что условие не правильно понял( на дорешке E и F понравились! Поздравляю авторов, ваш первый контест получился отлично!

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

I hate newbies

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

does unsuccessfull hack have panalty in this round,

I tried to hack some solution, but failed will my score be affected by this?

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

Was the cpp's hash function mechanics of unordered_map changed recently ?

cause i can't seem to hack solutions using the default unordered_map like before .

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

Can someone tell How can we solve G using bfs I was first storing the factors of the last number and then I was doing dfs and each time i find a new pair of gcd between two colunms then I am checking it to be divisible by a factor of last number . Help needed !!!

  • »
    »
    5 недель назад, # ^ |
    Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится
    1. store the factors of gcd(matrix[1][1], matrix[n][m])
    2. do dfs / bfs
    • check if (current_number % factor != 0) return false;
    • else complete checking the next till reaching matrix[n][m]
»
5 недель назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Really ? I just hacked Geothermal and Tourist ? you have to fix the hacks for G problem...

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

problem D first I used map for frequency and I got TLE I removed the map and I used a simple global frequency array but with t 1e4 and the frequency array being 1e6 it is not possible so what should I use here in this case?

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

    you can use same frequency array but you zero it at the end of a testcase using only values in a and b . or you can use an map with custom hash

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

      thanks the first one worked, I actually used a multiset for array m and used count() many time so maybe that's why I got TLE the problem is not in using map here because many people used map and it passed

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

Toooo many hacks for G.

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

you may want to rejudge G with a higher time limit, except you had a better intended solution

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

Many people were hacked on G.

Poor pretest.

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

My 320 hacks on G were about trying to achieve maximum number of possible GCDs for as many cells as possible, so that solutions that hold all GCDs using a slow data structure such as std::set will insert a lot of elements. My test made it more than a million elements per test case, and since we can have 20 of 100*100 tests in a single file, these solutions tried to insert more than 20M elements in total, leading to TLE.

But it seems like there are far more intense cases, as even my possibly more optimized solution couldn't pass, as well as several LGMs' solutions, and now with all the Unexpected Verdicts we can assume even testers' solutions are hacked...

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

It seems that E is more difficult than F.

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

Can someone hack my solution in E? 255743941

it's O(n³) with an optimization

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

G is so humorous!!!

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

what a sight. seeing Geothermal losing and regaining his high ranking after the contest

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

It seems that the validator for problem G is wrong. The problem said that the sum of n * m cannot exceed 2 * 10^5, but it can be hacked with such data.

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

    can you give a submission for a reference?

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

      Try mine, it will RTE#2226 in cases of violation.

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

        hey, also look at mine, it's gonna FST https://codeforces.com/contest/1955/submission/255724529

        The authors should change 2e5 to 1e5, and almost everyone with a logn factor passes

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

          FST for sure, see this comment for countertest ideas. There are better solutions than that.

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

            idk, why the testors had to make the problem so tight, and if yes, then they should have added this in pretests, i had a better solution in mind, but as this one passed, I wasn't bothered to submit another

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

              I don't know either, strict TL isn't a first-time thing. I also got TLE on another "better solution" as well, and that was because of suboptimal alloc. Though, on hindsight, 2e5 usually is a vanilla constraints, so I do feel like them brushing it off is a normal instinct.

              By the way, your earlier one won't pass, I just resubmitted to check and make sure — it still fails a test within limit.

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

                yeah, as i said, it's because of the log factor, if the constraints are relaxed, mine might pass.

                btw, yours is working?

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

                  Yeah, kinda — see the link I left on the first comment of this chain.

                  (I won't count tests from 36 and beyond as they breached the $$$2 \cdot 10^5$$$ limit for sum of all $$$nm$$$.)

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

Validate is wrong. cpp #include <bits/extc++.h> using namespace std; int main(void) { ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr); size_t constexpr T=30; cout<<T<<"\n"; for (size_t t=0;t<T;++t){ cout<<"100 100\n"; for (size_t i=0;i<100;++i){for (size_t j=0;j<100;++j) cout<<114514<<" \n"[j==99];} } return 0; } This passed the check.

  • »
    »
    5 недель назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится
    #include <bits/extc++.h>
    using namespace std;
    int main(void) {
        ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr);
        size_t constexpr T=30;
        cout<<T<<"\n";
        for (size_t t=0;t<T;++t){
            cout<<"100 100\n";
            for (size_t i=0;i<100;++i){for (size_t j=0;j<100;++j) cout<<114514<<" \n"[j==99];}
        }
        return 0;
    }
    
»
5 недель назад, # |
Rev. 5   Проголосовать: нравится 0 Проголосовать: не нравится

What is this ? I precalculated divisors for all elements upto 1e6 ( in MlogM time where M = 1e6 ) and solved the overall problem in (approx) cuberoot(1e6) * 1e5 time , still hacked ? solution

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

G hack amazing now

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

The time complexity for the Python judge is not being properly set.

I got TLE at test 3 for my submission in python (submission no — 255718411) I got accepted for same code in Pypy 3.6 (submission no — 255806654)

Due to this , I have made additional 2 negatives. It's NOT FAIR If you want you can check in my recent submissions

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

    Your Python submission and PyPy3 submission have different code. What are you complaining about? The Python one uses list.insert that is $$$O(n)$$$, and it's $$$O(n^3)$$$ in total, so I think TLE is the correct verdict.

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

      Just go to my profile and click on submissions and just click on show unofficial submissions and then check last two submissions (255848468 and 255848184)

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

So qsort is a poor way to solve cf problem? Since it can be hacked easily. I did not even imagine that qsort in stdlib have a O(n^2) situation, I thought it should have some method to prevent it from happening because it is in Standard Library! Forcing me turn to a cpp programmer? My rating is gonna drop for this ridiculous reason. ahhhhhhhhhh X(

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

    But I think write C in C++ is not a big deal.

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

    You can implement your own sort and copy it if you're committed to using C .

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

    It's not stdlib's fault. It's the algorithm's fault itself, as it has slow worst cases, but average cases being so fast that it is commonly used; yet in an environment where hack is allowed like Codeforces, worst cases actually matter.

    Perhaps making your own sort next time? IMO implementing something like merge sort isn't even much more difficult.

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

Can anyone explain G? I thought this is a simple standard Dijkstra algo to keep track the GCD for each path with PriorityQueue?

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

    Any path must start at (1,1) and end at (n,m) , therefore the gcd of the path must be a divisor of both. Simply check for each divisor if it could be the gcd using dijkstra or bfs.

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

    Your approach is wrong though. A greater GCD on a node won't guarantee greater GCD at the end, in case that GCD was a large but obscure number, which would quickly get diminished later on, while the smaller GCD prevailed.

    An example:

    1
    3 3
    684 342 18
    228 19 6
    12 6 684
    

    If you take $$$19$$$ as the GCD to go for cell $$$(2, 2)$$$, two $$$6$$$ on both possible ways onward from it will delete them all and result in a GCD of $$$1$$$ at the end.

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

        I did give a bad test to straight-up testing honestly.

        Found your counter test though, and it looks even weirder.

        1
        2 2
        84 84
        56 48
        

        How come it outputted $$$4$$$? (supposed answer is $$$16$$$).

        I have a feeling that your code overwrote GCDs in a weird manner, leading to only one GCD being chosen and it's hard to tell when it's optimal or not.

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

      When 684 342 19 6 684 then the tracked GCD becomes 1 and stay in the bottom of PQ. And other higher GCS in the other path can be considered in the next run.

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

Firstly I would like to acknowledge the contest author's effort and thank them. Now I can began my issue with the contest.

I think the statements for problems could have been more clear considering this is a Div 3. Also the explanations for the samples wasn't there or was not even helpful at all. I know that the author is not duty bound to explain the samples but with poor statement explanation I think this should have been done.

I did quite bad in the contest and to check whether I was feeling these issues because I did bad, I slept this off. Now even in the morning I feel the statements could have been better with better sample explanations.

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

Very good topic, each level is easy to difficult.

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

It is so surprising to see so many G solutions are hacked. Given that my rather standard DP solution https://codeforces.com/contest/1955/submission/255745682 is accepted just fine, now I wonder whether I have missed something important, like a more advanced approach that usually works better.

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

    The moment bro drew attention to himself...

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

    Lmao

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

    this can also be hacked sadly, I wrote similar solution and many more similar solution is hacked already.

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

      Now it makes more sense. It appears that the hack used 200 tests of 100x100 matrix, with the sum of n*m being 2000000 which is 10 times of the limit as specified in the problem statement. So it is likely an invalid hack.

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

    Hacked :)

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

      There are tests added by hack, like Test #50, contains 800 sub-tests each with 100x100 input, with a total sum of n x m 8000000, which is 80 times of the upper limit as promised in the problem. Now the whole thing become less interesting due to these invalid hacks.

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

Very good topic, each level is easy to difficult. Thank you

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

The problemset was good no cap. but it's really sad to see so many solutions being hacked. There's a lot to improve in testing.

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

so,is it rated?

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

fvck G

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

Wow... with what happening in G, I feel quite disappointed.

I could accept my code TLE'ing due to bad implementation caught in stresstesting, but allowing hacks to let loose because of validators going nuts?

Please, problemsetters, be extremely keen in validator writings. Crosstest and add various validator tests if possible. This is not even the first time in a long while this happened, and this problem even has pretty standard constraints that one shouldn't excuse of difficulty in writing conditional checks, so why letting the issue prevail?

I don't really want to disrespect the authors, the problems themselves are fine, but this time the underneath preparation has an absurdly critical hole that I feel like I need to raise my voice.

Proof that hacks go out of problem statements' defined boundaries, solution RTE with exit code 2226 is my personal indicator when that happens.

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

    The bad thing for me in the contest is, that I solved G directly after D, a similar solution like Geothermal, yet got hacked. The good thing is I participated in VC :)

    still I think the contest should be unrated as people who solved G directly after D would be paying prices otherwise :(

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

      I think this will depend on what actually had happened underneath. The best cases would be that only hacks having those breaches, thus those tests could be removed, relevant hacks reverted, and contest rated as usual.

      If even the original testset had limit breaches, then nope, unrated for sure (though as I quicktested the original testset was fine).

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

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

unrated

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

How come this test case passed for Hack

*******************************
*** The hack uses generator ***
*******************************

** Command line arguments **
no arguments

** Generated test **
999
100 100
100000 99998 99996 99994 99992 99990 99988 99986 99984 99982 99980 99978 99976 99974 99972 99970 99968 99966 99964 99962 99960 99958 99956 99954 99952 99950 99948 99946 99944 99942 99940 99938 99936 99934 99932 99930 99928 99926 99924 99922 99920 99918 99916 99914 99912 99910 99908 99906 99904 99902 99900 99898 99896 99894 99892 99890 99888 99886 99884 99882 99880 99878 99876 99874 99872 99870 99868 99866 99864 99862 99860 99858 99856 99854 99852 99850 99848 99846 99844 99842 99840 99838 9983...

** Generator source **


t = 999
n, m = 100, 100

print(t)

for k in range(t):
    x = 0
    print(n, m)
    for i in range(n):
        for j in range(m):
            if (j == m-1): print(100000)
            else: print(100000 - x, end = " ")
            x += 2

This is 1000*100*100 well beyond limits

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

Any idea why this code gets TLE on problem D ?

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

    the time complexity of multiset::count is $$$O(n)$$$, not $$$O(\log n)$$$

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

      To elaborate on the above comment, it is $$$\mathcal{O(k + \log n)}$$$ where $$$k$$$ is the number of occurences of the sought number in the multiset. So if the frequencies of your numbers are small enough, you can use multiset::count. But, in general if you want to only check whether a certain number exists in the multiset, multiset::find is strictly better, because it's exactly $$$\mathcal{O(\log n)}$$$, which is always better than $$$\mathcal{O(k + \log n)}$$$.

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

        Yes, this is more accurate.

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

        How to write that equation or the formula O(K+logn) sir? If you dont mind can you explain a little bit with an example.

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

          $$$\mathcal{O(k + \log n)$$$ (not actually three dollar signs, only one, but it's like this because if I don't put the backticks on either side, it just renders as $$$\mathcal{O(k + \log n)}$$$).

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

            $$$( O(K + \log n)) $$$ Thanks master. But how can I properly write this equation- $$$( O(nk^2/w$$$ + $$$k^3/w))$$$ can you tell me please.

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

              $$$\mathcal{O}(\frac{nk^2}{w} + \frac{k^3}{w})$$$

              This gives you $$$\mathcal{O}(\frac{nk^2}{w} + \frac{k^3}{w})$$$ (actually, I think your way ($$$\mathcal{O}(nk^2/w + k^3/w)$$$) looks better than this one, but you can use whichever one you think looks better). By the way, if you're interested in learning about LaTeX, this is a good place to start: https://artofproblemsolving.com/wiki/index.php/LaTeX:LaTeX_on_AoPS.

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

        thank you!

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

How was problem C guys? I was struggling to solve to solve it? But Finally I solved it.

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

A-find if 2*a<=b if so you can buy all ns with a, else buy (n/2)*2 with b and if n is odd add 1 B-sort the matrix and find the first number and then insert it in a vector, add d n times and find the value and insert them all in vector, then add c to the initial value of the matrix row and do this n times too C-Kraken attack (k+1)/2 shots from the start and k/2 shots from the end, just iterate over the array from the start and from the end and decrease the value as much as possible, if it becomes 0 add it to the answer D-store the values of b in map, and the values of first m elements in map, while doing that check if the values is second map were smaller than the value count in first map , if so do matched++, now iterate over the other values of a buy keeping an l(left) remove the left and add the right, simultaneously updating the map ,and updating the matched values as explained. E-Just iterate over all values of length to be the ans, then just reverse the length k segment whenever you find 0 in the string, at last if all are 1s this k is possible, hence find the maximum of such k F-first of all ans is a/+b/2+c/2+d/2 because their xor will be zero as the same value repeats twice, secondly is one of the a,b,c is absent then no further action is required as they wont add to the ans because of the placements of 1's in their binary representation, but is a,b,c are odd that means 1 ans can be extracted out of these 3 values hence ans++

rest ask from a higher rated coder,thanks :-)

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

Why so many Hacks on G? Even mine is hacked. Whats ideal expected TC for G? Is it better than O(n*m*100). Rating of G has gone from 1900+ (yesterday) to 2500+ (now) on clist :(

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

    The validator is incorrect, so tests which are above the limits can pass as hacks. But a fraction of the solutions are TLE even with a correct validator.

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

    The test validator is wrong.

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

Can someone explain to me how to approach problem F. I can only think when count of all 1,2,3 and 4 is even and when cnt(4) is even and count 1,2,3 is odd. These could be the 2 cases when bob can win. Unable to code the solution. thanks in advance.

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

    $$$cnt(4)$$$ is independent from the rest, so calculate it separately.

    For $$$cnt(1)$$$, $$$cnt(2)$$$ and $$$cnt(3)$$$, I prefer splitting into two cases:

    • Start from a state with all three values being odd, then subtract $$$2$$$ from each, add $$$1$$$ into answer each time.
    • Start from a state with all three values being even, then subtract $$$2$$$ from each, add $$$1$$$ into answer each time. Do not add $$$1$$$ at $$$(0, 0, 0)$$$ cases though, as there are no cards to play.

    Pick the better case out of the two, then add $$$\lfloor \frac{cnt(4)}{2} \rfloor$$$ in for the final answer.

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

    4 has independent bit compare others(1, 2, 3).

    So you can try O(N^3) DP on one, two, and threes.

    just calculate dp(one, two, three) + four / 2

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

255713576 Hey this is my first contest ever and only one of my submission got accepted. The thing is on running the same code for B , C and D I'm getting the required output but here on site it displayed otherwise. I understand that writing in python would slightly impact the time execution but probably shouldn't be the case up until i reach a way higher rating. So it would be great if someone could point out the logical errors if any or if there's way i should be submitting my code, thus providing me with pointers for the same. Thanks

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

    Also in regards to my rating, given the rules i should be eligible to participate and this should be treated as rated for me but it is still shown as unrated.

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

    I like your clean code, but you should optimise it a bit: 255745156

    It's normal to perform poorly in first contests, with practice it will get better

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

i think it's time to give it a try to change my color

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

The time limit and constraints for G are so stupid

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

I am curios to know why I got TLE on test 35 in G: 255703960

It is simple, try all divisors of $$$a_{1, 1}$$$ with $$$O(nm)$$$ dp.

We will have maximum 240 divisors (from 720720).

So maximum $$$<5 \cdot 10^7$$$ operation. std::vector construction can be strange but time limit is 3 seconds, it allows use nearly $$$10^9$$$ operation I think.

So how could I gotten TLE?

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

    Some people with the exact same idea still pass for some reason. Very weird constraints and time limit.

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

    I almost have the exact solution too and it TLE'd in test 35. Then, I changed vectors to global regular arrays and it passed.

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

    Even Jiangly wrote same solution as yours and got TLE,

    this solution is so obvious, I did similar, but what I did I precomputed the the divisors till 1e6 in log2(1e6)*1e6 time.

    still I have no clue how the hell my solution got TLE.

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

    Take my words with a grain of salt, but my suspect is that the alternating testcases here was not for show, but a deliberate attempt to cause cache misses and thus slowing down any time a "true" test begins, making it work with a worst-case speed every time.

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

    I also encountered this situation, and later I changed vis from a local vector to a global variable and it passed. I guess the 2D vector initialization in C++is very slow

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

    std::vector construction involves dynamic allocation (allocating from the heap). It is not a cheap operation. When $$$t = 10^4$$$ and $$$a_{1,1} = 720720$$$, you are doing it $$$240\times 10^4\times n$$$ times (times $$$n$$$ because you allocate for each of the rows). Which is significantly slower than just constructing once.

    Also, the nested std::vector<std::vector<...>> is not fully contiguous in memory, so you also get potential cache misses when you access the next row.

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

      Same code works fine locally though.

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

        By locally do you mean your own computer or codeforces custom invocation?

        Anyway, my point is that the difference between using a nested vector and constructing it many times, vs using a global array, is not subtle. And this could be a determining factor when the time limit is tight.

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

      can you please tell why vector::assign works faster than just creating it everytime with constructor?

      with constructor : 255927707, TLE

      with vector::assign : 255927628, 734ms

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

        Well, I believe that when using vis.assign(n, vector<int>(m)), you are only allocating one size $$$m$$$ std::vector (vector<int>(m)). While your code using the constructor, it is allocating $$$n$$$ vector of size $$$m$$$.

        When you use the vector::assign, it just tries to copy the second argument (vector<int>(m)) to each of the rows of the nested vector vis. Because initially every row of your vector vis had already allocated memory that could at least fit $$$m$$$ elements (you had constructed it outside the lambda with size $$$n\times m$$$), for each of this copy assignment, it doesn't require allocating any more extra memory.

        tldr: so you are allocating $$$n$$$ times less.
        number of heap allocation, worst case:
        constructor: $$$t\times d(720720)\times n$$$ = $$$10^4\times 240\times 20$$$ allocations
        vector::assign: $$$t\times d(720720)$$$ = $$$10^4\times 240$$$ allocations

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

H is interesting

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

My solution TLE — Solution1 Other Same Solution Passed — Solution2

What is this thing?

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

=

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

Looks like CF have problems with allocation, this solution(https://codeforces.com/contest/1955/submission/255842530) works 11s on test generated by this code:


t = 10000 print(t) for i in range(t): print(20,1) for i in range(18): print(720720) print(1) print(720720)

But local run is 2s... When I removed allocation of used in check -- it passed with 0.8s on cf.

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

when will rating changes come out ?

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

    During the next ~12 hours (I don't remember exactly, most likely even less) after the system testing ends

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

Because of your terrible hacking in this round, it's fair for you to receive a large number of downvotes.

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

    Be rational at what you are criticizing.

    If there would be anything to blame, the most critical would be the absurdly tight TL on G, and even that wouldn't be generally agreed — tight TL isn't the end of the world most of the time.

    Hacking due to loose validators is worth criticizing, but not downvotes. Main tests didn't breach it, hacks did, so nothing went wrong within the round. They are also reversible (and already been so at one point, as most of the hacked solutions have been rejudged with a proper testset). What more to blame?

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

      Well, I downvoted cos I can see solutions I have the same complexity with pass for G, while I get TLE. Plus, you're everywhere :D

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

        Can say I am having quite a lot of free time for now XD

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

          why is this contest not showing on my profile rating graph? It's not in all sections either.

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

            System testing underway, still a long while until rating updates, be patient.

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

              okay but I solved 4 questions during the contest and now it shows that I solved only 2, is it also due to system testing? Sorry for too many questions, kinda new here :)

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

                In system testing, all Accepted solutions are rejudged. Your other two are probably still in the queue and not yet rejudged.

                We can only wait.

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

                  okay, that makes sense. thank you!

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

                  system testing is complete, but the contest is still showing as unrated for me. my rating is 826, so this contest should be rated for me, right ??!

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

      Actually, I do think the problem G itself is created badly. I think a good problem should focus on examining the complexity of time or space, rather than optimizing constants, especially for a Div3. In that case, I think the data range should be at least 1.5 or 2 times looser than the optimal solution.

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

        I think it served that purpose normally. Judging that the original testset had nothing too strict in particular, I would say even the judges haven't really considered to stretch the constant optimizing, and only until a legit hack attempted to stress greatly into it, the complete revelation of contestants' bad implementations would begin.

        I think the data range should be at least 1.5 or 2 times looser than the optimal solution.

        Well, they did, kinda. You could compare some "good" implementations with the "bad" ones — and we only consider the "formal" solution i.e. BFS with all candidate divisors. Sometimes the difference go up to like 5-6 times, signifying the gravity of the issues which, in my opinion, have gone beyond planning.

        At this point, to blame the authors or not is pretty much a gray zone. Perhaps the integer constraints should have been $$$10^5$$$, but normally who would put that awkward limit for an array element in a number theory problem?

        I, however, believed that FST'd participants would take some responsibilities as well instead of fully diverting the blame. Cache misses and similar memory issues are actual things, and its nature is actually included in some fundamental teachings in computer science. It will be relevant if you wanted to pursuit this career later on, nonetheless.

        So perhaps we might be agreeing to disagree. It's fine that way though. I would only hope that we wouldn't bring down our judgment recklessly based on short-lived emotion bursts.

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

      Since it has already been rejudged, I'll retract some of my criticism from this incident.

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

Can anyone tell what might be the reasons of showing correct answer in compiler and wrong in codeforces?

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

    Most of the time due to undefined behaviors (UBs), and as your compiler/machine/etc. isn't fully identical to that at Codeforces, UBs will have different effect on different places.

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

      see my last code g wrong on test case 1. I have defined each variable

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

        Now I'm confused, like your WA1 submission is of an obviously wrong idea. I wonder how could any env give correct output with that...

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

Will the submissions to problem G that only fail on invaild tests be rejudged? Like this submission and this submission

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

https://codeforces.com/contest/1955/submission/255667514 Why is my solution giving TLE, can someone please tell(problem B Progressive Square)?

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

too many downvote :)

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

Why are you downvoting this post so much? I think even with the problem G's issue it was a great contest

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

Yesterday, it told me during the contest that my solution for problem B was accepted and it was shown in th rankings too. Today, it says that my submission for problem B is still "in queue". And the rankings don't show that I solved problem B either. Why is this? Can someone please help me out.

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

    This is known as system testing phase. Your solutions are being checked again and if they run correctly you will be given the points... Don't worry

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

Is it because a lot of Problem G solutions are getting TLE which is slowing down systest? The testing progress bar only went up by 2% in 30 min...

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

    probably not only problem G...

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

      It would've been nice to wake up to positive delta. Now I need to worry about whether my submissions for D & E will pass systest or not... :(

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

guys fst is your skill issue please stop downvoting

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

Can anyone help me figure out why my solution to D got TLE? Seems $$$O(n)$$$ to me.

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

how this code got accepted with 2999 ms in problem G

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

HELP HELP How to know when not to use Unordered Maps? or should i use just Maps always? Got TLE in 'B' bcuz of this BS

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

Problem D ; RIP python users, most of the solutions got TLE for test case 11. My solution as well got TLE for test case 11 (sad face). Please look into this if possible

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

"Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you."

Can anyone help me to understand why am I not rated in this contest even though I'm eligible.

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

This has been my second contest on here, but why is it showing up as unrated? "Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you." — doesn't this mean it should be rated for me?

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

    Rating hasn't been updated yet. Wait for a few more hours until it's calculated.

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

A<B<D<C<F<E

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

Problem D — Python

Directly create a dictionary with key as integers from array — TLE -> 255910556

Converted the integers in array to strings and then created the dictionary- AC — 255910798

Why??? :((

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

Why is this submission 255757792 for problem G giving TLE on test 35, but when using the same test on custom invocation, it finishes under 2 seconds. Don't the judge and custom invocation use the machine????

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

absurd checking, i was waiting to become specialist today, but -4 i get

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

EID MUBARAK to all muslim brothers !!

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

.

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

Eid Mubarak to Every coder

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

this comment is in queue

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

I got a mail saying my solution matches with many others, which i have no idea who they are. I don't know why such thing happened because the logic was very basic. Please someone tell what to do in such case.

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

Is that a gan cube :o

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

Problem E is the same as a problem for 2023 practice in my school.link