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

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

Hello, Codeforces!

We are happy to invite you to TheForces Round #13 (Boombastic-Forces), which will take place on May/07/2023 18:10 (Moscow time)

What is TheForces Round?

Editorial

You will have 120 minutes to solve 7 problems.

We strongly recommend you to read all problems.

Discord Server (700+ people)

Contests' archive

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

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

Nice problems. (i didnt tested yet XD)

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

As a tester, I will test round while listening the Mr. Boombastic song.

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

As a tester, I will test this round after writing this comment

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

As a tester, this is my first "As a tester" comment.

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

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

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

I can't register in this contest.What's the issue it is saying that you cannot participate in group contest

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

    If you're seeing this contest from TheForces group then you should join as a "participant" in the group to be able to register, Otherwise you can register for the round from GYM.

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

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

Educational-Forces

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

C was purely just annoying implementation (or knowledge about some standard functions).

I don't know how to solve D or E. I just recognised that both were standard problems (that I don't completely know how to solve) and just copied a solution from the internet.

F and G were nice though.

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

    G was just standered $$$O(n^3)$$$ dp right? $$$dp[i][j]$$$ denotes no. of ways to remove the subarray $$$[i..j]$$$.
    Transitions were $$$dp[i][j] = dp[i+1][j-1]*(a[i]>a[j]) + \sum\limits_{w=i+1}^{j-1}(2*dp[i][w]*dp[w+1][j])$$$

    Where am I wrong?

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

      Wait why is it 2*dp[i][w]*dp[w+1][j]? Wouldn't the coefficient of this term be factorial(L1/2+L2/2)*(factorial(L1/2)*factorial(L2/2))? Because we can choose the order in which we perform delete operations on these two subarrays

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

        Aaah got it! Thanks! Yeah you are right, the two subarrays are "independent", we can freely choose the order of the operations performed inside them.

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

          I didn't get AC though :( idk what's wrong with my approach

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

            Now I also updated the transitions, still getting WA :(

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

              Maybe setter's solution is incorrect (baby don't hurt me)

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

                You should try the following test case. I tried some of your submissions and they all gave wrong (and different) answers to this:

                Input:
                10
                2 1 4 3 6 5 8 7 10 9
                
                Output:
                120
                

                Explanation: You need to clear the following pairs (nothing else is possible):

                [2, 1]
                [4, 3]
                [6, 5]
                [8, 7]
                [10, 9]
                

                All of them are also independent meaning that you get $$$5! = 120$$$ removal sequences.

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

              Here is a test case where your code fails:

              Input:
              10
              2 1 4 3 6 5 8 7 10 9
              
              Correct Output:
              120
              
              Your Output:
              224
              

              Explanation: You need to clear the following pairs (nothing else is possible):

              [2, 1]
              [4, 3]
              [6, 5]
              [8, 7]
              [10, 9]
              

              All of them are also independent meaning that you get $$$5! = 120$$$ removal sequences.

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

            When considering this approach, i noticed double counting occurs after considering certain examples,so to avoid that we need to create another state k such that k = 1, means we need to fix end points i, j of the subarray in the last operation and $$$a[i] > a[j]$$$ and k = 0 means we can freely do the operations.

            So the transitions will be

            $$$dp(i, j, 1) = (a[i] > a[j]) * dp(i + 1, j - 1, 0)$$$
            $$$dp(i, j, 0) = dp(i, j, 1) + \displaystyle \sum_{k=i+1}^{j-2} C \left(\frac{l_1+l_2}{2},\frac{l_2}{2}\right) * dp(i, k, 1) * dp(k + 1, j, 0)$$$
            my code for reference
    • »
      »
      »
      12 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      check this out: https://usaco.guide/problems/cses-1080-empty-string/solution
      it's pretty much the same problem

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

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

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

The tests are strange? Are there any? Well, I like the problem, the rest is not important, for me. But I assume feedback to the round is ok.

I look at the code of problem D of 40th position at standings.

code

It got accepted.

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

    If that code really got accepted, then the test of that problem is kinda weak. A simple test like this will make the code fail:

    3
    1 2 3
    3 1 2