wuhudsm's blog

By wuhudsm, history, 13 months ago, In English

A

Idea:imranakki, wuhudsm

solution
code(C++)
Rate the Problem

B

Idea:Davy_D._Kaosar

solution
code(C++)
Rate the Problem

C

Idea:ProofByContradiction_

solution
code(C++)
Rate the Problem

D

Idea:wuhudsm

solution
code
Rate the Problem

E1+E2

Idea:xksark (easy version), wuhudsm (hard version)

solution (easy version)
solution (hard version)
code(easy version)
code(hard version)
Rate the Problem

F

Idea:wuhudsm

solution
code(C++)
Rate the Problem
  • Vote: I like it
  • +19
  • Vote: I do not like it

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

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

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

organizers are sigma. Thank you for contest

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

Generally, doing an operation in $$$[L,R]$$$ is to set $$$b[L]:= a value in [b[R+1],b[R]]$$$, then left shift $$$b[L...R]$$$.

Consider different $$$R$$$ (including $$$+∞$$$), the value range of $$$b[L]$$$ is $$$[0,b[L]−1]$$$, this corresponds to "taking any number $$$( \gt 0)$$$ of stones from the pile of stones in $$$b[L]$$$".

I didn't fully understand. Can you clarify why we are considered to be $$$b[L]$$$ not $$$b[R]$$$?

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

    Note that we are first setting a value in position of $$$b[L]$$$ and then left-shifting (cyclic!) the subarray $$$b[L, R]$$$ (not the other way round). Hence if we first set a value $$$b[L]$$$ to some value $$$x \in [b[R + 1], b[R]]$$$, then upon left shifting this subarray we get the following change

    $$$b[L, L + 1\ldots R - 1, R] \rightarrow b[L+1, L + 2 \ldots R, x]$$$

    which is what we wanted i.e. changing the $R$-th index to $$$x$$$.

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

    Assuming a player chooses the interval $$$[L, R]$$$ and reduces $$$x$$$ numbers by $$$1$$$. Observe the corresponding changes in the $$$b$$$ array, which corresponds to reducing $$$b[a[L]]$$$ by $$$x$$$ and reordering the array $$$b$$$.