wsaleem's blog

By wsaleem, 11 hours ago, In English

579968A - Different String

Check the number of unique characters in the string. If this is $$$1$$$, the string cannot be rearranged, otherwise perform any transformation that guarantees a different string, e.g. a cyclic right shift.

Original problem: 1971B - Different String, leads to official tutorial and all solutions including WS solution: 300389137

579968B - Young Physicist

Check if every column sums to $$$0$$$.

Original problem: 69A - Young Physicist, leads to official tutorial and all solutions including WS solution: 254038247

579968C - New Year Transportation

The user makes moves. The user is at index $$$i$$$ at the start of a move and at index $$$i+a_i$$$ at its end, which becomes the starting index for the next move. The user moves until the index exceeds $$$t-1$$$. If the index is now $$$t-1$$$ then the user has arrived, otherwise not.

Original problem: 500A - New Year Transportation, leads to official tutorial and all solutions including WS solution: 300594655

579968D - Polycarp's Practice

One solution is to identify the indexes, $$$i_1, i_2,\ldots,i_k$$$, and values of the $$$k$$$ largest values in $$$a$$$. The total profit is the sum of the values. $$$t_1=i_1$$$ (assuming 1-based indexing), $$$t_2=i_2-i_1, t_3=i_3-i_2$$$, and so on. Take care with the last index, $$$t_k$$$. If $$$i_k$$$ is not $$$n$$$, then $$$t_k$$$ will not include the elements $$$a_{i_k+1}, a_{i_k+2}, \ldots,a_{n}$$$. This can be fixed by setting $$$i_k=n$$$.

Original problem: 1006B - Polycarp's Practice, leads to official tutorial and all solutions including WS solution: 300648369

  • Vote: I like it
  • 0
  • Vote: I do not like it