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

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

Hello, Codeforces!

I'm very glad to invite you to participate in CodeTON Round 4 (Div. 1 + Div. 2, Rated, Prizes!), which will start on 31.03.2023 17:35 (Московское время).You will be given 8 problems and 2 hours to solve them. The round will be rated for everyone.

I'd like to give my sincere thanks to:

Hope everyone can enjoy the round!

UPD: The tutorial is here.

And here is the information from our title sponsor:

Hello, Codeforces!

We, the TON Foundation team, are pleased to support CodeTON Round 4.

The Open Network (TON) is a fully decentralized layer-1 blockchain designed to onboard billions of users to Web3.

Since July 2022, we have been supporting Codeforces as a title sponsor. This round is another way for us to contribute to the development of the community.

The winners of CodeTON Round 4 will receive valuable prizes.

The first 1,023 participants will receive prizes in TON cryptocurrency:

  • 1st place: 1,024 TON
  • 2–3 places: 512 TON each
  • 4–7 places: 256 TON each
  • 8–15 places: 128 TON each
  • 512–1,023 places: 2 TON each

We wish you good luck at CodeTON Round 4 and hope you enjoy the contest!

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

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

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

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

As a tester, give me TON.

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

As a tester, problems are great, recommend everyone to participate!

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

May this will be my color change contest

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

Finally a div1+2 round after half month.

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

Hope I can bounce back from my horrendous performance last time.

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

Nostalgia hit me.

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

My first div1...ready to face the challenge

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

so excited !

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

As a tester, problems are educational and wonderful, hope everyone can enjoy

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

TON is about 2.10$, Thank me later :)

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

hope to be Expert

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

    You are already Expert bro . What are you talking about? This time you will reach it . I will try not to blunder this time.

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

As a tester, give me TON.

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

Hope I will solve A anh B @@ As a participants, hope everyone have the best work!!

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

I will AK it using Genshin Impact:)

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

.

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

Where will these ton tokens be transferred? I mean we haven't filled a wallet address whole registration neither is there a link to put our wallet address on website or any other place.

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

Can anyone explain why we can read many times ".... give me a TON"?

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

As a tester, I think this contest is very worthwhile to participate in. I hope everyone who join this contest can get satisfactory results.:)

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

We need a TON of positive delta rating!

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

I hope to reach 2100, and I wish everyone all the best!!

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

Will try to cross 1500 this time. Looking forward to solve upto 4 problems.(atleast 3).

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

facing long in queue problem!!

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

Will a scoring distribution be announced?

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

I'm jiangly fan,jiangly is No.1!!!

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

I really wanna reach 1900 today. The mark has been psyching me out for so long now. I dont wanna care about my rating!!!! I wish me and you all the best!! (I just wish it a tiny bit more for myself :D)

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

Where's score distribution?

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

Where's score distribution?

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

What Happened to tourist ?

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

jiangly! best of the best

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

I'm very excited to see editorial for task H!

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

Good round! Sadly I ran out of time for D and I think I would have been able to solve with ~10 more minutes.

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

hard round.

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

Problems were great overall, but needing to use Fibonacci Heap for E in Java to not TLE was obnoxious.

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

    standard heap runs fine in pypy

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

    What exactly was your solution, you should be able to use bucket sort since values are in $$$[0, n]$$$.

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

      Small to big with a disjoint set, where you merge the smaller priority queue of edges into the bigger priority queue every time you need to merge two nodes.

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

        Very convoluted. Suppose you add all vertices with $$$a_i = X$$$ to the graph with all $$$a_i \leq X-1$$$. If you can defeat $$$X$$$, you can defeat the component. If you can defeat $$$X$$$ now, you could have defeated $$$X-1$$$ before, which means you were able to defeat the component. You can maintain if the whole component is defeatable together with its size in DSU.

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

Problem B is the same problem as one of the problem in Constructor Open Cup Contest yesterday

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

    Ah... An interesting coincidence :( The two contests are so close.

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

    Actually there was a small difference: solution was guaranteed in Constructor Open Cup, and today there was a -1 option.

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

The time of which of the submissions counts to the result on codeforces? The first or last?

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

B is almost absolutely the same as a problem in Constructor Open Contest 2023 which was yesterday

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

Submited D in last second but system didnt register it, also B is harder than C or D

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

    I just drew a binary tree from 1 and got the greedy idea, and I found B quite easier than C (just my opinion) Didn't even get time to look at D

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

Problem E is solvable using "Kruskal Reconstruction Tree" technique. The weight of edge (u, v) is max(a[u], a[v]). After we built the tree, we climb from leaves with a[u] = 0 and check if we can climb up to the root in the reconstruction tree.

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

    It's also solvable with Boruvka's algorithm + BFS

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

      I solved it with DSU and merging sets

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

        Also solvable by shuffling all zeroes and performing BFS from each of them. The only optimization is to start only from zeroes which we had never reached before.

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

          Wow, that is smart. What is the expected complexity of your solution?

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

            I would like to know that too.

            Edit: Even without shuffling, this algorithm will visit each node at most $$$\log(n)$$$ times. So the upper bound complexity is $$$O(m \log^2 n)$$$. Maybe with shuffling we can get smth better.

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

              I did this too: I think it's $$$O(m\log n)$$$ since the expected number of 0s you start from is $$$O(\log n)$$$ and each time you can explore almost all the edges in the graph?

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

                Could you explain how the expected number of 0s we start from are $$$O(log n)$$$ ?

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

          Correct me if I'm wrong, I think you don't need to shuffle the zeroes as the worst case will only visit all N nodes at most log(N) times.

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

            Yeah, got it, you are right. So we don't need to shuffle and the overall complexity is at most $$$O(m \log^2 n)$$$ using priority queue inside BFS.

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

              why are we visiting each node at most $$$logn$$$ times ?

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

            This complexity analysis is so hard. I came up with the solution immediately but didn't dare code it because I though it was $$$O(n^2)$$$. Now I play around some linked-list cases and can see that it is indeed impossible to reach $$$O(n^2)$$$, but can you please elaborate on how to prove $$$O(mlog^2n)$$$?

            Edit: it was in the editorial.

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

          I did the same thing. Here is my solution. 200012713

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

          I upsolved the prob using a similar strategy, But I didn't realize that that optimization would be enough, so after performing each BFS, I combined all visited nodes into a "super-node" to make sure that i didn't iterate over each node too many times. The core logic is super similar tho.

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

Any hints for D?

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

    try to keep the minimum and maximum possible length of the tree after each query

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

      thanks, was very close to this just made some calculation mistakes

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

How to do E?

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

bool isPossible(long long int mid, long long int height, long long int a, long long int b) { if(((a-b)*(mid-1LL)*1LL) + a >= height) return true; else return false; } long long int calDays(long long int height, long long int a, long long int b) { if(height == 0) return 1; if(height <= a) return 1; long long int left = 1; long long int right = 1e18; while((right - left) > 1) { long long int mid = left + ((right - left)/2); if(isPossible(mid, height, a, b)) right = mid; else left = mid+1; } if(isPossible(left, height, a, b)) return left; else return right; }

In question D, I was trying to find number of days taken by snail to reach height h, given a and b using Binary search. Is something wrong in my approach as I am getting WA in TC5.

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

    probably overflow on (a-b)*(mid-1LL)

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

      So, taking long long right = 1e9 will solve the overflow issue? BTW I don't think overflow is the problem, because I have submitted the code with a value of right less than 1e9. And still I got WA in TC5.

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

    Same problem with me! But why BS doesn't work here??????????????

    It is equivalent to the direct math formula, both calculate the same.

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

Can anybody Tell me why my code fail in Problem C

https://codeforces.com/contest/1810/submission/200015122

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

    Firstly,You haven't considered all possible start mex values(according to your code you have checked for 1 and 2) and even after this,all possible combinations of insertions and deletions that are possible are not considered (try looking at the editorial or look into my submission for a better understanding of it) Happy Codeing:)

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

Any ideas why this D is failing pre-tests? I spent 1 hour debugging and could not find the bug:

https://codeforces.com/contest/1810/submission/199997167

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

I got 7 WAs on D trying to use binary search before realizing it was just math...

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

is Div2D solvable with just math?

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

Determining whether a node is good (you can start from the node and reach the entire graph) is just implementation.

The solution of E is quite straightforward when you observe that if a node is not good, the nodes it can reach are also not good.

Edit: Systest accepted, but not sure if there is an test case that will TLE this

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

Nice div1+div2 contest. Solved A-E. My solution of F passed pretest but it's very likely to get TLE on system test.

A: We just to need check if there's any i where a[i]<=i.

B: We can only get odd number by operation, so if n%2==0 there's no solution. Otherwise, we can represent (n-1)/2 in binary, and add 1 to all digits (for example: 17 -> (17-1)/2=8 -> 8=1000(2) -> answer is 2 1 1 1).

C: First we can remove all numbers and add single 1, which costs n*c+d. Otherwise, assume the size of the final permutation we get is k (and k>1), and there are m missing numbers in range [1, k] in the initial array. Then we need to add m numbers and remove (n-(k-m)) numbers, the cost is c*(n-(k-m))+d*m = c*n + (c+d)*m — c*k. If we let k+=1 and m+=1 (which means, k+1 is a missing number in the initial array), the cost will increase by d, so in any optimal answer, k must be a number in the initial array. So we can iterate for every possible option of k and get the answer.

D: Implementation problem. We just need to maintain the upperbound and lowerbound of h for each type-1 query, and for type-2 query we need to check if the answer for (h_max, a, b) and (h_min, a, b) are the same. Be careful for case a>=h.

E: DSU. We sort edges (u, v) by the value of max(a[u], a[v]) and add them by this order. First mark all nodes with a[u]==0 as good. WLOG assume a[u]>=a[v]. When mergeing (u, v), if v is good and the size of component of v is not greater than a[u], we mark all nodes in the component of (u, v) good. To defeat all monsters, we need the graph to be connected and all nodes are good.

F: The answer is ceil(log_m(sum(m^a[i]))). We need to maintain the base-m representation of sum(m^a[i])) by a segment tree, and update it by binary search.

Update: Upsolved F with atcoder library: 200024728

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

    Amazing performance today! (despite FST!)

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

    FST((

    Anyways congratulations with almost becoming red!

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

    gratz! Great performance anyway, amazing result of your constant upsolving

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

    Can you please explain logic behind (n-1)/2 in B?

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

      Let f(x)=(x-1)/2 and see how operations affect f(x):

      Operation 1: x --> 2*x-1

      f(x)=(x-1)/2 f(2*x-1)=x-1

      which is: f(x) --> 2*f(x) (put a 0 after a binary number)

      Operation 2: x --> 2*x+1

      f(x)=(x-1)/2 f(2*x+1)=x

      which is: f(x) --> 2*f(x)+1 (put a 1 after a binary number)

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

    For problem B, I didn't get this point "Otherwise, we can represent (n-1)/2 ". Can you explain a little bit more?

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

      Yeah i dont get it too lol

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

        I think he is trying to say that since number is always odd as we progress from 1 to our desired number n, that we can go from n downwards in this fahsion:

        we could get to n etiher by number (n-1)/2 or by number (n+1)/2, whichever of them is odd(other one always isnt) is the number from which we came to n

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

    Could you (or someone else) please elaborate the logic behind your algorithm for E? I don't seem to understand it at all. Thanks!

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

Although managed to solve D and probably will get positive delta, still problem D was awful in my opinion. There was nothing interesting about it. It just required being extra careful, which is very annoying.

A was ok, B and C were nice.

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

I don't understand problem D, anyone help me:((

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

Problem D is really orz

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

As a contestant who won 4TONs, please give me TONs

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

Jiangly!!!

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

May I know why my problem A's submission is still in pretest passed stage?

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

weak pretests on E? I passed pretests in 295 ms and seemed to have failed systests :(. Hurts more since I was going to reach CM.

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

    Looks like this is on me. My solution is the same as edi's except I set visited as 0 for all nodes each time I bfs instead of setting visited as 0 only for nodes visited in the last bfs which significantly worsens complexity.

    Still sad how the pretests didn't catch this.

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

A round with a 200000000 parcel?

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

Congratulate nightcrawler0112 for submitting the 2e8-th solution 200000000 in this contest!

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

Due to a network failure, I accidentally submitted my solution to problem D twice (see 199967726 and 199967904) and got a resubmission penalty. Is there a way to get my score back?

Also, hats off to everyone who prepared this fantastic contest, and I'm excited to finally become red after 5.25 years of cp!

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Help! Why is the code for my question D passable in GNU C++17 or GNU C++14, but not in GNU C++20? I used the ceil function at first, but changed it later and still had the same problem. Here is the link to my code:https://codeforces.com/contest/1810/submission/200022673
»
13 месяцев назад, # |
  Проголосовать: нравится -15 Проголосовать: не нравится

Awesome contest (at least problems A-D)!

However I have a question regarding the problem D. This is what some test case (second test case in Example) can look like:

3
1 6 5 1
2 3 1
2 6 2

The answer is

1 -1 1

Why is the second number $$$-1$$$, and not $$$3$$$?

From the first event we can get that $$$h=6$$$. That is the only possible solution for $$$h$$$. We have $$$h$$$ and in the second event we are given $$$a$$$ and $$$b$$$. We can now calculate $$$n$$$ with formula $$$n=$$$ $$$\lceil \frac{h-b}{a-b} \rceil$$$ and that equals $$$3$$$.

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

Anyone knows why my C fails?

https://codeforces.com/contest/1810/submission/199982867

Any help is appreciated.

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

Is it suspicious if someone submits D and E with 8 mins gap and there's different style of giving brackets in all the submission (submissions of D and B don't have extra space before curly braces while E, C and A have)

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

How do we receive TON, if we ranked below 1024? Did we have to fill some form or will we automatically receive mail for the same?

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

Isnt the test case 5 of C wrong, the min cost comes out to be 22, not 20.

Dropping a duplicate 4: 2

Inserting 1,2: 2*8 = 16

Dropping 7,8: 2*2 = 4

Total = 2+16+4 = 22

while the answer is given to be 20. Can someone help me with this, if I am wrong? Thanks

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

Finally turned purple with this contest. Thanks for the Amazing round!

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

D was undoubtedly unclear problem statement. Much more clarification was needed

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

How and when do we recieve toncoin prizes

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

Can someone please help me with my submission of problem D submission Thank You

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

    Try avoiding ceil() function. ceil() has some precision issues for large numbers. That's why your answer is wrong for large input. Use below, it will get accepted.

    void tim(ll up,ll dw){
    if(l==-1){
    cout<<"-1 ";
    }
    else{
    ll lb=1+((l-up)+(up-dw-1))/(up-dw);
    if(l<up)lb=1;
    ll ub=1+((r-up)+(up-dw-1))/(up-dw);
    if(r<up)ub=1;
    if(ub!=lb)cout<<"-1 ";
    else cout<<ub<<" ";
    }
    }

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

@RDDCCD

RDDCCD

EDITORIAL IS NOT ACCESSIBLE.

I had written one comment on yesterday's editorial. After which I had received some downvotes. Is that why I am banned from seeing an editorial page...

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

    i dont think so, i cannot see it either :3

    Edit : editorial is open again

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

    Ah, that's maybe because I was wrting the editorial of H at that time. I don't know it will make the editorial unaccessible :(.

    Anyway, editorial for H is finished now.

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

Has anyone received TON coins? When will it be released?

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

Edit: I just received it, thank you!

Am I the only one who didn't receive the ton prize?

It's been over a month now.

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