Is there a sub-linear approach for this dynamic scoring problem?

Правка en2, от UncarvedBlock, 2026-02-26 15:53:41

Problem: Dynamic Scoring System

Hello Codeforces community,

I have been battling with an algorithmic problem for quite some time, and I would appreciate any insights on a sub-linear approach.


1. Inputs

There are $$$n$$$ players and $$$k$$$ gems. We maintain four arrays of length $$$k$$$:

  • $$$prev_i$$$: Price of $$$i$$$-th gem at the previous time step.
  • $$$curr_i$$$: Price of $$$i$$$-th gem at the current time step.
  • $$$r_i$$$: Rate of appreciation of the $$$i$$$-th gem.
  • $$$t_i$$$: Timestamp of the last update of $$$r_i$$$.

At $$$t = 0$$$, each player chooses two gems: index $$$u$$$ (numerator) and index $$$v$$$ (denominator) with fixed quantities $$$q_u, q_v$$$.


2. Updates

At each time step $$$t \gt 0$$$, at most one of the following occurs:

  1. Price Update: For a gem $$$i$$$, the value of $$$curr_i$$$ is updated. (Note: $$$prev_i$$$ takes the previous value of $$$curr_i$$$).

  2. Rate Update: For a gem $$$i$$$, $$$r_i$$$ is updated to a new value and $$$t_i$$$ is set to the current time $$$t$$$.


3. Scoring System

The score of a player at time $$$t$$$ is defined by the following recurrence:

$$$ Score_t = Score_{t-1} \cdot \frac{curr_u \cdot prev_v \cdot (1 + r_u(t - t_u))}{prev_u \cdot curr_v \cdot (1 + r_v(t - t_v) + 0.5 r_v^2(t - t_v)^2 + 0.17 r_v^3(t - t_v)^3)} $$$

Initial Condition: $$$Score_0$$$ is given for each player.


4. Output

Find the indices of all players whose $$$Score_t$$$ is below a given threshold $$$th$$$.

Constraint: The solution must achieve a worst-case time complexity better than $$$\mathcal{O}(n)$$$ per time step.


I would deeply appreciate any help from your end!

Best, UncarvedBlock

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en7 Английский UncarvedBlock 2026-02-26 21:24:38 2
en6 Английский UncarvedBlock 2026-02-26 21:23:26 11 Tiny change: '6-02-26]\n\nEdits: \n' -> '6-02-26]\n--- \n\n### Edits: \n'
en5 Английский UncarvedBlock 2026-02-26 21:19:18 716
en4 Английский UncarvedBlock 2026-02-26 16:11:48 966
en3 Английский UncarvedBlock 2026-02-26 15:54:41 37 Tiny change: '# Problem: Dynamic Scoring System\n\nHello Code' -> 'Hello Code'
en2 Английский UncarvedBlock 2026-02-26 15:53:41 91
en1 Английский UncarvedBlock 2026-02-26 15:52:26 1640 Initial revision (published)