Dominater069's blog

By Dominater069, 2 years ago, In English

Hello Codech....err i mean Codeforces!

I invite you to participate in Codeforces Round 934 (Div. 1) and Codeforces Round 934 (Div. 2) which will start on Mar/16/2024 17:35 (Moscow time).

You will be given 6 problems and 2 hours 15 minutes to solve them in both divisions. Division 1 has $$$\textbf{2 subtasks}$$$, and Division 2 has $$$\textbf{1 subtask}$$$.

Joining us on the problem setting panel are:

I would like to thank MikeMirzayanov for platforms Codeforces and Polygon.

Please do read a few problems in advance at the very least. Especially with all the subtasks, it is strictly in your benefit to read and choose the problems you want to try. Good luck. We hope you enjoy the problemset.

Score Distribution will be posted soon.

$$$\textbf{UPD}$$$ : Score Distribution :
Div2 : 500 + 1000 + 1500 + 2250 + 2250 + (2250 + 2750).
Div1 : 500 + 1250 + 1250 + (1250 + 2000) + (2000 + 1500) + 4500.

$$$\textbf{UPD2}$$$ : Sorry for the issue with the queue towards the end. Hope you enjoyed the round.

$$$\textbf{UPD3}$$$ :
Div2 :
1) WanYuanShenWanDe
2) solar_tree
3) kcodex
4) zhukau
5) Oinng123

Div1 :
1) tourist
2) jiangly
3) gyh20
4) Benq
5) ecnerwala

$$$\textbf{UPD4}$$$ : Editorial is out.

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

| Write comment?
»
2 years ago, hide # |
 
Vote: I like it +54 Vote: I do not like it

As a tester, I would like to know when the next cookoff will be.

»
2 years ago, hide # |
 
Vote: I like it +37 Vote: I do not like it

As a tester, I recommend to break your fast on this meal.

»
2 years ago, hide # |
 
Vote: I like it +30 Vote: I do not like it

As a tester, Dominater069, Everule and satyam343 orz

»
2 years ago, hide # |
 
Vote: I like it +116 Vote: I do not like it

As a tester, C++20 when?

»
2 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

As a tester, good luck to all participants.

»
2 years ago, hide # |
 
Vote: I like it +25 Vote: I do not like it

As a tester, lunchtime when

»
2 years ago, hide # |
 
Vote: I like it -56 Vote: I do not like it

Cringe announcement

»
2 years ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

What is a subtask? Are there any prior examples to try it?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Subtask means the problem will be divided into two parts, one will be easier with lower constraints and one will be harder with higher constraints.

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it +2 Vote: I do not like it

      Thanks. I thought it's something special that deserved highlighting in announcement

»
2 years ago, hide # |
 
Vote: I like it -32 Vote: I do not like it

As a participant, i will participate

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +1 Vote: I do not like it

Congrats, Dominater069 on your first codeforces round!

»
2 years ago, hide # |
 
Vote: I like it -24 Vote: I do not like it

So many testers !

»
2 years ago, hide # |
 
Vote: I like it +34 Vote: I do not like it

I was really excited to do this contest but now i discovered that I'm a tester D:

»
2 years ago, hide # |
 
Vote: I like it +30 Vote: I do not like it

As a tester, the problemsetters cooked.

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +150 Vote: I do not like it

I'm sorry, but Div.1 is very important, so why not take the option of postponing it?

It is a bit sudden, considering that changes in the available C++ compilers have made some libraries effectively unusable or slowed down (if you make heavy use of long longs).

»
2 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Congratulations on your first contest, Dominater069

And also Good Luck for every parcipicant!!!!!

»
2 years ago, hide # |
 
Vote: I like it -21 Vote: I do not like it
»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Umm... Why is the eligibility range for Div. 2 from 0 to 1899?

»
2 years ago, hide # |
 
Vote: I like it +17 Vote: I do not like it

Dominater069 rounds gotta be one of my favourite genders

»
2 years ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

what do you mean by subtasks? can somebody explain please

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Negative rated testers tho :)

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

problem in div 2 is subtask 1 in div 1 ??

»
2 years ago, hide # |
Rev. 3  
Vote: I like it -69 Vote: I do not like it

downvoteforces

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

As a tester, the problems are really good and I would recommend the participants to read all of them.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I did the round yesterday thinking that I would get to 1900 and get to compete in Div 1 this round. But the rating changes have not come through yet. Anyone know if I'll get to 1900 before the contest?

»
2 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Is the mean of "subtask" like 1939D - Big Persimmon (one problem but have partial points), or like D1/D2 (two problems without partial points)?

»
2 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Since so many LGM's demanding C++20, can someone elaborate what's the difference between C++14,17,20 etc...

»
2 years ago, hide # |
 
Vote: I like it -63 Vote: I do not like it

Again Clashing with LC Biweekly, have to skip

»
2 years ago, hide # |
 
Vote: I like it +20 Vote: I do not like it

2250 for div2D is too high.

»
2 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

BCD1 with the same score, looks interesting

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

orz, I hope to reach Specialist soon. Good luck to all participants!!!

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +5 Vote: I do not like it

Ah yes! A negative rating tester!

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

4500? Serious?

»
2 years ago, hide # |
Rev. 2  
Vote: I like it -9 Vote: I do not like it

Dominater069 Great to see you as the author on CodeForces Contest!!

»
2 years ago, hide # |
 
Vote: I like it +20 Vote: I do not like it

So many subtasks. Is it possible to make a 5-hour IOI rated contest?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What is penalty time ?

»
2 years ago, hide # |
 
Vote: I like it -10 Vote: I do not like it

Amazing problems haha, Dominater069 rounds are always so fun, This one had a codechef taste (Bitwise and Game thoery), loved it.

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

newbie here i come

»
2 years ago, hide # |
 
Vote: I like it +31 Vote: I do not like it

In queue.

»
2 years ago, hide # |
 
Vote: I like it -10 Vote: I do not like it

how to approach B ?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Hint:

    First consider the 2*n size array where, in first half all elements from 1 to n are present and in the remaining half all elements from 1 to n are present {these two half will have same xor}.

    then, try to think what will happen if we swap some of the elements.

»
2 years ago, hide # |
 
Vote: I like it +41 Vote: I do not like it

imagine submiting your code in the last 10 minute and get long queue, then it give you a WA verdict after contest

»
2 years ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

There's a bunch of submissions in queue. Will the round be extended?

»
2 years ago, hide # |
 
Vote: I like it +20 Vote: I do not like it

my code is not submitting from last 10 minutes, its stuck on pretest 1??

»
2 years ago, hide # |
Rev. 6  
Vote: I like it -69 Vote: I do not like it

<

»
2 years ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

The examples seem a little simple so that I have a lot score penalty. qwq

»
2 years ago, hide # |
 
Vote: I like it -47 Vote: I do not like it

These 2250 are slightly eazier than average.

Trash sample.

I'm back, GM.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

What was the catch in the problem C? Alice has to pick numbers in increasing order. Bob will remove minimum x such that cnt[x]<=x. Right?

Can someone provide a counter-test-case for my solution?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I love problem div2D.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

My solution for D looks like shit

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

gameforces!

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

Ok, can somone please tell me whats wrong with my solution? 251789210

I ran stress test but nothing came up ...

EDIT: Nevermind ... got it

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Man, I'm stress testing with actual AC codes rn and nothing's coming up. What the actuall fuck

  • »
    »
    2 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it -10 Vote: I do not like it

    Can you share the test case?

    Edit: Nvm, system tests are over

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    Hello , I took a look at your solution , you only subtract 3 when the sequence is alternating ababababa, but it's actually you need to remove all the odd values, 3 5 7 ...

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Can anyone here pls explain D to me?

»
2 years ago, hide # |
 
Vote: I like it +234 Vote: I do not like it

I think it wasn't a nice decision to decide to extend the round at the last minute.

  1. Many people were ready to just spoil all the solutions, and if someone didn't tell them that the round is extended, a serious accident could happen.
  2. There are also people (like me) who gave up to solve a problem because the time left wasn't enough, but if they kept trying, they could probably solve it in the extended time. It's unfair that those people could only lose more rank.
  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it -102 Vote: I do not like it

    there was a long queue (~10mins) towards the end of the contest, its the only fair decision

    • »
      »
      »
      2 years ago, hide # ^ |
      Rev. 2  
      Vote: I like it +146 Vote: I do not like it

      No, the only fair decision is to make the round unrated (I mean, it might be a valid argument that the "unfairness" was allowable, though...).

      I received the notification of the extension only after the extra time. I was lucky to notice it at some point, but the site was too unstable and I just spent almost-offline time...

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Same, I left before the round was finished.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +56 Vote: I do not like it

    Fully agreed. Also, no announcement was sent to Div1 contestants before the scheduled end time.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +29 Vote: I do not like it

    But never give up until the last moment, right? Leaving early is not the right approach.

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      The problem is, When there were 20 minutes left, I decided to go with problem F, which is harder but with less code. As long as I solve it, I can quickly write it in 5 minutes. But If I know I have 30 minutes, I will go with problem E, since I already solved it, but I don't have enough time to code. Extension at the last minute is useless for me, I can't do anything with C and E.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +44 Vote: I do not like it

    I apologize that the original announcement of extension has not reached the Div1 participants. Normally, it is sent simultaneously to both contests, however, I can see that this time it has only been sent to Div2. I guess either I misclicked, or the system malfunctioned.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +25 Vote: I do not like it

    Did not get the notice of the extension and hence did not submit D2 which was a couple minutes of debug away. :(

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it
»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve Div2D

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    If the substring has all identical characters, the answer is zero. If the substring contains alternating characters such as ababab, the answer is summataion of all even $$$k$$$. Otherwise, all $$$k \geq 2$$$ contribute the answer, except the original substring, which will contribute only if it is not a palindrome.

    The crucial idea is : If you have a palindrome, and you append a character at the end, there are a very limited set of scenarios in which the new string would also remain palindrome (that's where the motivation for alternating string comes in).

  • »
    »
    2 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +1 Vote: I do not like it

    wrong

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Fuck me , i thought problem B was finding non intersecting subarrays with equal XOR, and my Solutin passed the first test , i'm so fucking blind man

»
2 years ago, hide # |
 
Vote: I like it +26 Vote: I do not like it

1C is MUCH easier than 1B.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Can you share it's solution.

    Spoiler
    • »
      »
      »
      2 years ago, hide # ^ |
      Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      Let the diameter of the tree be $$$d$$$.

      When $$$d$$$ is odd or $$$\lfloor \frac{d+1}{2} \rfloor$$$ is odd, select the node in the middle of the diameter for operation.

      When $$$\lfloor \frac{d+1}{2} \rfloor$$$ is even, let the middle two nodes of the diameter be $$$x, y$$$, and then operate on $$$(x, 1) (y, 1) (x, 3) (y, 3) \dots$$$

      Spoiler
      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it +13 Vote: I do not like it

        Proving this is quite simple, use the fact that any operation turns at most 2 nodes of the diameter black. Since the diameter must be made black you get a lower bound of $$$\frac{len + 1}{2} + 1$$$ operations. The case when $$$len \equiv 3 \mod 4$$$ you can do the 2 center nodes tactic. To prove that you cannot do better when $$$len \equiv 1 \mod 4$$$ you can just arrange the diameter nodes in a row. Any operation that colors 2 nodes will color 2 nodes with the same index parity. But there are $$$\frac{len + 1}{2}$$$ nodes with each parity. The number is odd, thus you cannot match the last 2 nodes together and need to do them separately. This is no better than the "Take one node and all the distances" tactic.

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it +27 Vote: I do not like it

      No. I don't actually know, why is $$$n \le 2000$$$, when I could solve it in $$$O(n)$$$. Probably, it is hard to create checker in $$$O(n)$$$.

      Find any diameter. Let its length is $$$D$$$ (the number of vertices on it is $$$D + 1$$$). There are two cases:

      Case 1: $$$(D + 1) \mod 4 \neq 3$$$ (not 3, 7, 11, etc.). Then we have to find one vertice on center on diameter and simply do $$$d = 0, d = 1, d = 2, \dots$$$.

      Case 2: $$$(D + 1) \mod 4 = 3$$$. In this case we can optimize one operation. Look at examples:

      *-a-b-*
        | |
        * *
      

      The upper horizontal line is a found diameter. We can take vertices $$$a$$$ and $$$b$$$ and do operations $$$(a, 1)$$$ and $$$(b, 1)$$$. Using algorithm from first case we could find following operations: $$$(a, 0)$$$, $$$(a, 1)$$$ and $$$(a, 2)$$$, which is worse.

      *-*-*-a-b-*-*-*
        | | | | | |
        * * * * * *
          | | | |
          * * * *
            | |
            * *
      

      We can do operations $$$(a, 1)$$$, $$$(a, 2)$$$, $$$(a, 3)$$$, $$$(b, 1)$$$, $$$(b, 2)$$$, $$$(b, 3)$$$.

      So, in this case we use two vertices on the center of the diameter.

      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it +8 Vote: I do not like it

        "Probably, it is hard to create checker in O(n)." — Absolutely right. That was the reason :)

      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        I think you forgot to say that for even $$$k$$$ we can skip $$$(a, k)$$$ and $$$(b, k)$$$, so on the last example we only need to perform 4 operations $$$(a, 1)$$$, $$$(a, 3)$$$, $$$(b, 1)$$$, $$$(b, 3)$$$

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      I couldn't stick this solution (which you described) in during testing. I tried very hard to do it :)

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

    You might be surprised to hear that it was actually placed at 2F(1D) when I tested

»
2 years ago, hide # |
 
Vote: I like it -30 Vote: I do not like it

Well done, Amazing performance Kevin114514. It was a nice comeback, indeed!!! 🔥🔥

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Is problem D related to hashing?

»
2 years ago, hide # |
Rev. 3  
Vote: I like it +65 Vote: I do not like it

For me this round is very Bad

Very weak samples propably on purpose

Ideas in div1B and div1C are really easy to get but corner cases are really easy to miss

Maybe its me but i really hate such rounds

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Try random DP approach for F1 but still can't do it :((

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Dforces

»
2 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

I did this in div1 problem B. Is this an intended solution?

There are three cases.

Case 1: There is only one character in a string: $$$aa \dots aa$$$. In this case the answer is $$$0$$$.

Case 2: The string is of form $$$ababab \dots aba$$$, and its length modulo $$$2$$$ doesn't matter. In this case the answer is $$$2 + 4 + 6 + 8 + \dots$$$ and if a string itself is not a palindrome, then additionally $$$+ length(s)$$$.

Case 3: Else the answer is $$$2 + 3 + 4 + 5 + \dots$$$ and if a string itself is not a palindrome, then additionally $$$+ length(s)$$$.

To check the form $$$aa \dots aa$$$ or $$$abab \dots abab$$$ of a string I used prefix sums for all characters.

To check, if a substring is a palindrome, I used polynomial hashes with segment tree.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Yes, this should be correct. By the way, since we are already using polynomial hashes, can't we just compare substring hash with its reverse for equality?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    Checking whether the substring is a palindrome or not within the given constraints was the most difficult part for me

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +39 Vote: I do not like it

    For polynomial hashes of a substring, you can use some sort of prefix sums, instead of a segment tree, because there are no updates.

  • »
    »
    2 years ago, hide # ^ |
    Rev. 3  
    Vote: I like it +10 Vote: I do not like it

    I think that for checking if given substring in a string is a palindrome, we can use Manacher (but I also did it with hashes)

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Did exactly same, still getting WA on test 2, maybe some edge case, disappointing contest for me.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    You can also use manacher algorithm for checking palindrome. It's O(n).Manacher

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone help me what's wrong with my B solution?

Spoiler
»
2 years ago, hide # |
Rev. 2  
Vote: I like it +11 Vote: I do not like it

I am so mad at myself atp, because I missed not in 1B, and I was trying to solve it the whole time >:(

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to do div2D (shortest way)

  • »
    »
    2 years ago, hide # ^ |
    Rev. 4  
    Vote: I like it 0 Vote: I do not like it

    For even: if k < full_length_substring, good = all characters are same
    For odd length: if k < full_length_substring, good = all even position characters are same & all odd position characters are same.

    full length needs to be calculated manually, I used manacher algorithm.

»
2 years ago, hide # |
 
Vote: I like it +19 Vote: I do not like it

The king is back in the game...

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

is there any other way to solve Div2 D without using Manacher algorithm(tourist 251709195 used it) but it seems a bit tricky Anyone with any other approach

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +27 Vote: I do not like it

tourist #1 jiangly #2 what a beautiful sight to see

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone explain what is wrong with this solution for C problem of div2:

{
 
            List<Integer> res = input.nextInts();
            int n = res.get(0);
 
            List<Integer> arr = input.nextInts();
 
            Map<Integer, Integer> fre = new TreeMap<>();
            arr.forEach(it -> fre.put(it, fre.getOrDefault(it, 0) + 1));
 
            int mex = 0;
 
            while (mex < n) {
                if (fre.getOrDefault(mex, 0) > 0) {
                    mex += 1;
                    if (fre.containsKey(mex)) {
                        if (fre.get(mex) <= mex) {
                            break;
                        }
                    } else {
                        break;
                    }
                } else {
                    break;
                }
            }
 
            output.write(mex + "\n");
        }
»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

251791328 Div2-D why this submissions RE?It run ok in my computer.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Problem E, found centroid and then just dfs'd out as far as possible and printed unique distances... what case does it WA? https://mirror.codeforces.com/contest/1944/submission/251783755

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

In div2D, how do you check if a substring is a palindrome or not in constant time?? I implemented the rest of it completely but just didn't know how to get through this part. It was incredibly frustrating ffs.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    You can use rolling hash (aka. Rabin-Karp) or Manacher's algorithm.

  • »
    »
    2 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +1 Vote: I do not like it

    You can use string hashing. If you're afraid of implementing string hashing by yourself, you can use this mini library provided by USACO guide.

    Library

    Using this library, the code is as simple as

    # Hash str and rev(str)
    if hash.get_hash(l, r) == revhash.get_hash(n - 1 - r, n - 1 - l) 
        s[l...r] is a palindrome
    

    My Submission

»
2 years ago, hide # |
Rev. 3  
Vote: I like it 0 Vote: I do not like it

I solve div2E as follow first i try every node as starting then i try every adj pair as starting the operation and take the best out of all why it didn't pass any countr example??

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

What's wrong with my solution 251724861 for Div 2 1944B - Equal XOR?

Edit: Got it

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

nice balanced round, good job, guys

»
2 years ago, hide # |
Rev. 5  
Vote: I like it 0 Vote: I do not like it

Test case : 9 1 0 7 7 7 6 1 2 0 Output must be 3 but its 2 as if Alice choose 0 then Bob would choose 2

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Think what if Alice instead of taking 0 initially she took 2 and then Bob if goes for 0/1 there will still be 0/1 left to take.

»
2 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

For Div1E, why is the answer 3 here?

9 5
8 9 6 10 10 9 3 10 7 8
  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +29 Vote: I do not like it

    If you try to get mex=4, Alice chooses 2, Bob removes 2 copies of 3, 2 copies of 1 and 1 copy of 0, Alice chooses 0(or 1, it doesn't matter), Bob removes 2 copies of 1 and 3 copies of 3, Alice removes 1(or 3, it doesn't matter), Bob removes 5 copies of 3, loss for Alice.

»
2 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Nice Round. Upsolved Div2 D after the Round. Learnt How to check s(l...r) is palindrome or not in constant time using Hashing by converting to Integer in base 26.

One doubt , I stored these hashed values mod 1e9 + 7 , it passed the cases but Isn't it possible that two string might give same hashed values mod 1e9 + 7 ? If yes how to avoid such cases ?

  • »
    »
    2 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +3 Vote: I do not like it

    possible, but very unlikely

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it

    you should do double hashing to make sure it doesnt happen in the future

  • »
    »
    2 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +3 Vote: I do not like it

    You can store two hashes with different constants to almost completely eradicate this possibility. I got hacked during the competition because I used only one hash, fortunately I managed to add another hash in time. This is my submission. There is also a good paragraph about reducing collisions on cp-algo.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    or you could use manacher's algo which will give you the longest palindromic substring at every center. Its much easier as code is available at gfg.

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Big gap between 2C and 2D, and IMO 2B was harder than 2C. Problems were good.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Anyone has any hint how to go from 1D1 to 1D2 ? Thanks

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

For Div2 Problem B Equal XOR I have the following submission https://mirror.codeforces.com/contest/1944/submission/251835494 but it gives wrong answer l is not subset of a[1, n] (test case 37) for test 2 and I have 0 idea why. I sorted the indices in l and r so this shouldn't happen unless l contains elements which are not in [1..n] (or [0..n-1] as I have them 0-indexed in my program). Does anyone have at least an example for which my solution fails?

  • »
    »
    2 years ago, hide # ^ |
    Rev. 3  
    Vote: I like it 0 Vote: I do not like it

    1

    3 1

    1 2 2 1 3 3

    Your solution greedily takes the value. So when it encounters the first 1 it immediately insert it into the first array .As a result the output contains 1 less element

»
2 years ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

Yes, it's tourist ranking first, finally! Hope tourist can get back to the rating leader again!

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

received WA 15 times on pretest 2 for problem 2C/1A

discovered that there was no output on one test case 1 0

fixed and immediately got AC 🤡

»
2 years ago, hide # |
 
Vote: I like it -61 Vote: I do not like it

Trash D1 AB, and Terrible samples

»
2 years ago, hide # |
 
Vote: I like it +45 Vote: I do not like it

When will the ratings be updated?

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Congratulations,jiangly goes back to the first rating.

»
2 years ago, hide # |
 
Vote: I like it -9 Vote: I do not like it

Winner of Div. 2 is called WanYuanShenWanDe??? Why Genshin Impact ("YuanShen") is everywhere, even in Codeforces?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good problems,thx.

»
2 years ago, hide # |
 
Vote: I like it +47 Vote: I do not like it

So when will the ratings be updated?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a tester, good luck to all participants.

»
2 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

When will the ratings be updated? Why is the rating updated so slowly this time?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

in problem 3 of div2 9 1 0 7 7 7 6 1 2 0 let this be the test case, i think here answer should be two but it's three

explaination->in first turn alice choose 0, then bob choose 1, then alice choose 1,then bob choose 2 and thus by any next turn alice will not get two and mex will be two

»
2 years ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

the contest is rated or unrated

»
2 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

When the rating will update ?? It's taking a lots of time

»
2 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

please provide an update on when the rating will be updated?

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +3 Vote: I do not like it

When will the ratings be updated? On some div1/2 contests, it is as immediate as lightning once the round ends, rating updates. On other hand, for other contests, it delays. This delayed lot.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

i got WA on D because someone found strings with the same reverse hash. with this, you can hack anyones code. is this fair?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

there was a discussion between the contest writer Dominater069 and LGM's regarding that all of Div1 participants did not receive the message. convo I guess they might be checking manually the number of affected Div1 participants so they can get their round unrated as it happened in the last round where 18 people were manually addressed.

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Finally became a Expert haha

»
2 years ago, hide # |
 
Vote: I like it +38 Vote: I do not like it

my actual rank in this round is 1192 and its showing in common standings but in my recent contests its showing my rank is 4811 and i got a 106 negative .. can someone address my problem ?

»
2 years ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

negative/xia

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Check 4th test of problem A

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

wrong output format Unexpected end of file — int32 expected (test case 200)

what does this error mean?

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

Can someone give an example test case where single hash might fail on Div2D?

I submitted a single hash solution which got AC, but someone in the comments said that their single hash solution got hacked.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    Here you go, I hacked you to illustrate.

    1
    20 1
    hcnrinqugrwpxdnkotqu
    1 20
    

    The point is you can somewhat easily find collissions for single-hashes if you know the modulo/base, so you should default to double hashes usually.

»
2 years ago, hide # |
 
Vote: I like it -6 Vote: I do not like it

too easy C.too hard D.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Wow, I arrived slightly late in this contest just to discover there isn't a single question in the 1300-2000 difficulty range. Welcome to speedforces, and I already lost before it even had began

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone suggest what is wrong in my submission for div2 C problem.

251924677

My idea was that Alice and Bob will always pick up the smallest available element that occurs once in the array. What is wrong in that?

My submission failsin 363rd test case.

»
2 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

In my opinion the score of Div. 1 E should be 1250 + 2250 instead of 2000 + 1500...

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

Ended up getting wrong ans in D due to hash collision, changing the value of p worked.

Incorrect submission-https://mirror.codeforces.com/contest/1944/submission/251985522

Accepted-https://mirror.codeforces.com/contest/1944/submission/251985606

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

For those of you still waiting on some editorials, this may be of slight help. My editorial on Div2 A to D (the last two being Div1 A, B): https://www.youtube.com/watch?v=fZK7hiemXOE&t=10s

»
2 years ago, hide # |
Rev. 3  
Vote: I like it 0 Vote: I do not like it

For Div2 C / Div1 A

for the test case 9 1 0 7 7 7 6 1 2 0

how the output is 3 ? First Alice removes 0, then Bob removes 1 then, Alice removes the second 1, now Bob removes the 2 and now Alice cannot get a 2 and cannot make MEX equals to 3

Kindly help me understand this

»
2 years ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

tourist is back