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

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

Hello, everyone!

The 24th Japanese Olympiad in Informatics (JOI 2024/2025) Final Round will be held from Sunday, February 02th, 10:00 UTC to Monday, February 03th, 10:00 UTC. The contest information is as follows:

  • Contest duration: 4 hours (You can choose start time freely in 24-hour window)
  • Number of tasks: 5 tasks
  • Max score for each task: 100 points
  • Style: IOI-Style (There may be some partial scores)
  • Problem Statement: Japanese & English

Note that since the contest ends at Monday, February 03th, 10:00 UTC, if you start the contest after Monday, February 03th, 06:00 UTC, the duration will be shorter than 4 hours.

The registration page and live scoreboard will be announced 30 minutes before the contest starts. Details are available in the contest information page.

We welcome all participants. Good luck and have fun!


UPD1: The contest will start in 12 hours.
UPD2: The contest is started.
UPD3: The contest is ended. Thank you for your participation.

Теги joi, ioi
  • Проголосовать: нравится
  • +242
  • Проголосовать: не нравится

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

bump

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

How to solve the

$$$1, 1, \dots , n - 1$$$

case in P5?

My solution for the 12 points was some simulation. In each moment of time, I move the package at the post office which is furthest from its destination. My intuition for this was that it would maximize the number of simultaneous movements that happen, but I can't prove it formally lol

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

    The proof of your claim is also pretty intuitive. Notice that when two packages meet, they will follow the same path until one of them reaches its destination. If we decide to let the one that has a shorter path go first, then the other one will still have at least 2 edges to pass through after the first one arrives at its destination.

    From that greedy solution, we can make another claim: for an edge, the last time some package passes through it is only dependent on the distances of packages passing through this edge.

    The intuition here is that all the edges before will "sort" those packages the same way as the current edge will. Packages that end before that edge will have a lower priority than all the other ones, so they won't change the order in which packages come to this edge.

    To calculate the answer on each edge, we can store the distances on a segment tree. If you handle distance offsets well, the cycle becomes a simple sweepline. Tree parts of the graph work similarly but require small-to-large merging of those segment trees.

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

Where can I find the editorials?

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

How to solve P4

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

    You can get 46pts using bitmask dp.

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

      Can you elaborate? Maybe implementation?

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

        Note that it can always be done with 21 ties, even if we don't ignore any of the audience numbers: assign each tie to one of 1, 2, ..., 21, and for each audience number, only make moves to the tie we assign to that number.

        Then, for each index $$$i$$$ in the numbers $$$A_i$$$ called out by the audience, we can figure out the possible sets of all lengths of ties after that number is called. The answer, then, is after $$$A_n$$$ is called out, the set with the least number of 1 bits. This will take $$$2^{\max A_i}$$$ for each index, for a complexity of $$$O(2^{\max A_i} \cdot n)$$$.

      • »
        »
        »
        »
        14 месяцев назад, скрыть # ^ |
         
        Проголосовать: нравится +7 Проголосовать: не нравится
        Definition of the dp
        Base Case
        Calculating dp
        Final answer
»
15 месяцев назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Where can I upsolve?

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

My code (joi25*.cpp)

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

Are test data and standard programs available?

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

Could you explain your solutions for problems even for 1-st problem?

  • »
    »
    14 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится +10 Проголосовать: не нравится
    using 0-based indexing.
    Let c = a + b[1:] (excluding the first index)
    sort c.
    
    
    We have got recursion, g[i][j] = max(g[i][j-1],g[i-1][j]) where i>0 and j>0, if we look at carefully,
    
    a[0] b[1] b[2] .. 
    a[1] max(a1,b1)  max(max(a1,b1),b2)
    a[2] max(max(a1,b1),a2)  max(max(a1,b1),max(a2,b2))
    
    We can observe that g[i][j] = max ( max(a[1],a[2],..,a[i]) , max(b[1],b[2],..,b[j])) for i>0 and j>0.
    if we compute prea[i]=max(a[1],a[2],..,a[i]) and preb[j] = max(b[1],b[2],..,b[j]) then g[i][j]=max(prea[i],preb[j]) for i>0 and j>0.
    
    f(x) = number of (i,j) such that g[i][j]<=x.
    computing f(x) is very easy by using prea and preb, just binary search the maximum index of prea and preb with value <=x , let it be cnt1,cnt2 then the answer is cnt1 + cnt2 + values in c <=x.
    now for each value x in c get cnt by f(x)-f(x-1) and print maximum count and the maximum value with the count.
    
    Time: O(n*lg(n))
    
»
14 месяцев назад, скрыть # |
 
Проголосовать: нравится +47 Проголосовать: не нравится

For problem D, I wrote a brute force bitmask dp ($$$O(n2^a)$$$), and deleted all states that will not contribute to the answer. That is to say, if there are two states $$$S_1,S_2$$$ with the same number of $$$1$$$, and for every $$$k$$$, the $$$k-$$$th highest $$$1$$$ of $$$S_1$$$ is always not smaller than $$$S_2$$$, then we can delete $$$S_2$$$. The check was simply brute force, so the complexity is $$$O(nk^2a)$$$ where $$$k$$$ is the maximum number of states at a single position. However, it passed all the tests with a maximum time of only 1 second. Can anyone prove that the number of states is small or give a hack to this solution?

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

Will there be analysis mode?

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

Why does JOI every time have such mean grading criteria? What was the point of having such a slow ascent from ~60 bits to ~20 bits in fortune telling?

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

Hello! can someone explain why this solution for problem D doesn't get TLE?

I mean, isn't its complexity $$$O(N*2 ^ {21}))$$$