ok12's blog

By ok12, 2 months ago, In English

I hope you enjoyed the contest!

Contest link

Rating Predictions and Tags for the Problem

Tutorial for the Problems


A. Game is Game

Author: Proelectro444, ok12 Solution: ok12

Solution

B. Hakurei Shrine's Purification Ritual

Author: ok12 Solution: ok12

Solution

C. Permutation Game

Author: ok12 Solution: ok12

Solution

D. Path Blow-up?

Author: Soumil69 Solution: Soumil69

Solution

E. Coffee Date of MEX

Author: ok12 Solution: Soumil69, ok12, dpsvoyager.16

Solution

F. Wordleforces

Author: Arnav_Singhal1 Solution: Arnav_Singhal1

Solution

G. Adaptive Guessing

Author: GeoMetrix123 Solution: GeoMetrix123

Solution

H. Mirror Check Failed

Author: Soumil69 Solution: Soumil69

Solution

I. Hamming Hamsters

Author: nem Solution: Soumil69, VectorVirtuoso

Solution

J. Shhhh... Its a Ghost

Author: ok12 Solution: ok12

Solution

K. Lost in Signals

Author: VectorVirtuoso Solution: Soumil69

Solution

L. Metro Network

Author: FrostBlaze Solution:Soumil69

Solution

M. Mathy sequence

Author: rock0fages Solution: rock0fages

Solution

N. Easy Mex Problem

Author: Soumil69 Solution: Soumil69

Solution

We really hope everyone enjoyed the contest and thanks to ANCC Team for making the contest successful and supporting us and guiding us throughout the preparation.

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

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

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

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

why does in problem F it says an ordered string of length m if permutations were considered, i am not sure, but it might be that i am not able to understand the problem or that there is typo in problem, which is the case?

Thx for the contest, though.

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

    No typo.

    The secret is an ordered string (since you must match it exactly to get a “Correct” verdict). However, if your guess is wrong, the judge only returns the multiset intersection (counts of common letters) without positions.

    So you’re trying to find an ordered string, but you only get the multiset information until the correct guess.

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

      ohh i see, i was thinking word "ordered" as "arranged" (as in lexicographically). understood now, thx/

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

Great contest, I particularly enjoyed problem N. I derived $$$f(u) = \frac{(size(u) - 1)!}{size(v_1)! \times size(v_2)!\times .. \times size(v_m)!} \times f(v_1) \times f(v_2) \times .. \times f(v_m)$$$ and implemented it directly; it just used a bit of extra memory. 364963561

One minor suggestion: Problem B’s statement changed from unordered to ordered pairs mid-contest. It would have been helpful to have a formal announcement for that change. Overall, really enjoyed the contest!

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

Edit: The solution turned out to be wrong

An alternative solution to G:

While n>3, we can query {n , n-1 , n+1}, if all these are 0 then it implies that X in range [1,n-1]
When n==3, we can ask the following queries: {2, 4, 3, 2} and we will determine X.

The total number of queries is 3*(n-3) + 4

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

    What if Alice is at n-1 initially, and moves to n n-1 n after your first 3 queries?

  • »
    »
    2 months ago, hide # ^ |
    Rev. 4  
    Vote: I like it +11 Vote: I do not like it

    This order is incorrect. [Edit] I am actually not sure if your order is really incorrect

    However, the order n-1 n+1 n seems to be correct.

    We had AC with it.

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

      Both the orderings are incorrect, my ordering fails the case given by chicubed

      In your ordering, the first 6 queries would be:

      (N-1) (N+1) ( N ) (N-2) ( N ) (N-1)
      

      The position of X can be:

      (N-3) (N-2) (N-1) ( N ) (N+1) (N+2)
      

      After this we can keep moving X forward.

      I think the problem just can't be solved using such orderings.

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

      https://pastebin.com/J96MbKpn

      I think the testcases are just weak, added a checker to your sol (just sim all good positions using a bitset)

      you fail if you initial position is n — 1, you guess n, then I go to n, you guess n + 1, then I go to n + 1 and so on

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

Problem N can be solved more easily.
Assume the root (say node $$$1$$$) has label $$$0$$$.
Then having a connected component with $$$\text{mex}=k$$$ for all $$$k$$$ is equivalent to $$$\text{label}(u) \gt \text{label}(\mathrm{par}(u))$$$. This is nothing but number of topo-sorts of a tree. So, we just need to find number of topo-sorts of the tree considering each node $$$u$$$ as the root.

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

For the question A. Game is Game, Consider the test case 5 5 5 4 4 4

here Alice can get 5 and Bob 4 as final score, yet the solutions accepted shows Alice gets 9 and Bob 0. If Bob played optimally understanding the maximum he can get is 4, he can get 4.

  1. Alice take a 5.
  2. Bob take a 5.
  3. Alice take the last 5. Alice have 5 points.
  4. Bob take the 4.
  5. Alice take the 4.
  6. Bob take the 4. Bob get 4 points.

Final score : Alice — 5 Bob — 4

Am I missing something here?

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

    Alice takes 5 Bob takes 4 Now if Alice takes 5, bob takes 5 else Alice takes 4, bob takes 4.

    If alice starts the game by taking 4 then bob takes 5.

    Bob can always ensure that he takes 9 leaving Alice 0.

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

K=n construction for E, if anyone wants. 365116634

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

In problem F while intuitively it's correct is there a proof for why strings without all distinct characters will not be the worst case?

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

    First, you need at least n/m queries for checking which all letters are present in the word. Then assume you got k(<n) distinct letters, so the number of queries you need to find the frequency of each letter is k (you can do this by querying k-1 single characters and rest equal to the remaining one character) Then say the frequencies are $$$a_1, a_2 \dots ,a_k$$$, then you need to query all possible permutations of these letters which takes $$${k!}/{{a_1}!{a_2}!\dots{a_k}!}$$$ , so the maximum number of queries you can get in such case is n/m + k + $$${k!}/{{a_1}!{a_2}!\dots{a_k}!}$$$. This expression is always less than n/m + m! which is the number of queries required when all characters are distinct. (Please note that in the explanantion I have not taken care of ceil or floor of n/m. I have only given a brief reasoning of why the solution in editorial works.

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

Guys, support our flash mob and go to the "банда мопсоу" organization, and also put this picture as your avatar. Thanks to everyone who took part