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

Автор O--O, история, 13 месяцев назад, По-английски

Hello, Codeforces!

We are happy to invite you to TheForces Round #8 (ICPC-Forces), which will take place on [contest_time:433200]

As it's an Indian ICPC week we tried to prepare one good team-based contest which can help you for ICPC preliminary round.

You will have 3 hours to solve 11 problems. The problems are not sorted by difficulty.

The top places will be published after the contest.

Discord Group (500+ people)

Contests' archive

Did you like the contest?

UPD: Rejudged every submission.

UPD: TOP PERFORMERS ---

Rank Name
1 satyam343
2 simiao1986
3 K-423, acfinity, megurine
4 AhmetKaan, qwexd, early-morning-dreams
5 cuiaoxiang
6 achvanov
7 Adam_GS, Everule, Dominater069
8 kachhuaa, chiki_D, vrintle
9 sevlll777
10 vgtcross

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

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

Wow, 11 problems

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

Psychotic_D worked very hard for the contest, and came up with some really cool problems.

Please participate. I hope you enjoy the round.

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

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

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

I only tested Psychotic_D's question, his question has educational significance and short statements. The style is close to Codechef, and there is no heavily implementation.

I think it's fun to think about how to optimize complexity as much as possible for each of his problems.

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

Few Things I want to add as problem setter,

I would like to say thanks to the problem setter and testers.

  • dbtalaviya — For really cool problem ideas and python testing for some of the problems.

  • merlin_ — Tried his very best as a tester and be a JAVA tester. I have no words to appreciate him properly.

  • JUBHAI — testing some of the problems in python and a very first tester.

  • Khonshu08 — Discussing some other problems with me and testing.

  • _Prince — Testing problems and for proposing some ideas.

  • EndlessDreams — For special testing.

  • Little_Sheep_Yawn — for testing almost full contest in python.

  • O--O — For the community TheForces and background support.

Lastly, I hope you people will enjoy the contest as a team. I would love to hear any type of feedback after the contest. We tried to make it a good practice type contest.

UPD: Thanks for making the contest wonderful by taking part in it. I hope you guys enjoyed the problems. You can give me any kind of feedback for future improvements.

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

I will give this gym today!!!

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

Why name is changed from SHA-Forces to ICPC-Forces?

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

Are the problems sorted to the difficulty?

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

Thanks for good work, can I contribute too ?

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

Did you like the contest?

YES!

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

How to Solve Problem K — Equal subsequence My Idea was to use prefix sum and suffix sum but getting wrong answer on test 2

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

Amazing and a very balanced problemset, loved it. Psychotic_D orz!!

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

Any hints for B and D ?

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

      How to modify the DP for C?

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

        You can notice that type of DP you are able to easily maintain in segment tree. So you can calculate minimal answer for any substring in $$$O(\log n)$$$. Now you can solve it with two pointers or binary search

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

          i did $$$dp[i][remOp][last_digit]$$$ to calculate states in B. where i is the current index remOp is remaining operations and last_digit is the previous digit in the string but i just don't know how to maintain the states in a segment tree.

          can you explain in detail please

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

            Let's change our dp a little bit and make number of changes $$$remOp$$$ what we calculate, not a dimension. $$$dp[l][r][x][y]$$$ will be minimal number of changes to make substring $$$s[l \ldots r]$$$ good with digit $$$x$$$ at the front and $$$y$$$ in the back. We can merge neighbour segments in $$$O(1)$$$ and segment tree only needs $$$O(n)$$$ such segments to store

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

    Hint for D : DSU

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

    You can also use binary search on the length of substring that can be the answer and check for all possible substrings of that length. To check whether a given substring can be a good substring, (Longest non-decreasing subsequence)+k >= length of substring.

    PS : You can calculate Longest non-decreasing subsequence using segment tree in O(logn) with O(n) preprocessing as there are maximum 4 unique characters.

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

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

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

Great contest as usual !

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

As a tester and laxy person, I hope I am not late to ask for upvotes.

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

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

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

problems were really amazing !! enjoyed the contest.

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

enjoyable contest

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

How to solve H??

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

https://codeforces.com/gym/433200/submission/197820770

why this is giving Memory limit exceeded using queue whereas other datastructures similar to queue such as priority queue are passing the same test case can someone help?

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

How to solve J?

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

Can someone explain problem H please, i couldn't get it !

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

Problem C was cool, just upsolved it. AC with 3572ms

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

    Can you please explain your code in detail?

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

      If you know segment tree then it's a just a variant. First like problem B (easy version), assign some numbers to each character (i.e. '7' to 0, '4' to 1, '8' to 2 and '5' to 3).

      You need to create a node of segtree which will have the information about the cost of change of all combinations of endpoints possible of a good string (start number <= end number).

      Just merge each two node by their possible intermediates.

      Do a BS to find the max possible length starting from i which has cost less or equal to k for each starting i.

      Take max over all possible i and output it.

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

        Can You please share your DSU based approach of Problem D?

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

          Sure! so we need to connect the adjacent one by one in increasing order of numbers and by DSU we can easily find no of connected components (initially n * m). As two components concatenates one count decreases so we can simply check if we have connected all the cells which has number less ore equal to x has exactly n * m — x + 1 components or not.

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