When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

fvogel's blog

By fvogel, history, 22 months ago, In English

Hello Codeforces,

I couldn't find any blog on this year's round C so I decided to create one. Feel free to post your feedback and ideas on the contest.

Personally for me the start of the contest went pretty well. Problem D was particularly interesting and I solved it quickly. However I found problem C quite harder and got quite a few WAs. But I finally got a perfect score!

I plan on hosting a live discussion about the problems from this contest today at 6:00 PM UTC. The link will be posted here shortly. See you there!

Happy coding :)

UPD: Here is the link: https://www.youtube.com/watch?v=jvc_4ZT9da4

UPD 2: There's been a bug, here is the new link: youtube.com/watch?v=SL1-YYocQik

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

| Write comment?
»
22 months ago, # |
  Vote: I like it +15 Vote: I do not like it

Got stuck on C, went to D, copypasted dp, got AC, went back to C, started crying.

Was C simulating it very fast or smth else?

  • »
    »
    22 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Only subtasks 1 and 2 can be solved with clever brute force

    • »
      »
      »
      22 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      can you tell what's your approach?

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

        For each ant, find all the ants before it moving to the right and those after it moving to the left. Then you can notice that when two ants meet, only their indices swap but everything else stays the same, so if you don't care about their indices it's fine to just simulate the process. So sort the left part in descending order and the right part in ascending order then you can just brute force the intersections in $$$O(n)$$$.

  • »
    »
    22 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How did you approach D? I knew it had to be dp but couldn't figure out transitions and other stuff. Was it a well known problem?

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

    Can you solve the easier question: when will the last remaining ant fall off? The key observation from that problem is quite useful in C.

»
22 months ago, # |
  Vote: I like it +5 Vote: I do not like it

I also solved D but didn't solve C.

»
22 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

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

unable to solve C, is that kind of bfs ?

»
22 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
22 months ago, # |
  Vote: I like it -8 Vote: I do not like it

I made Video Solutions for all problems in case someone is interested.

»
22 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

pls anyone give hint about problem c

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

ya nice round