NeoYL's blog

By NeoYL, history, 11 months ago, In English

This is my personal note and might be some kind of user editorial/learning material for some people!

This is the seventh episode of this "note" series. I will write notes on problems (normally around 2500-ish problems), that are both interesting and educational. I normally will spend a few hours on each problem so please be patient when reading the blog.

If you want to motivate me to write a continuation (aka note 8), a significant upvote from you would be well appreciated! If I received lots of downvotes (because I'm also spending a lot of time to write this and to learn latex only to express my ideas accurately to you guys), I'm probably not gonna continuing writing these blogs.

Difficulty rating
Tags

Problem link

Problem paraphrased:

You are given an array of length $$$N$$$. When you reach $$$i$$$, you will jump to $$$i+a_{i}$$$. Find the the number of jumps and the last index before jumping out of bounds (that is also $$$>N$$$) if you start at $$$i$$$.

You are given $$$Q$$$ operations, to change the value of $$$a_{i}$$$ or query when you start at position $$$i$$$.

Hint 1
Hint 2
Hint 3
Solution

AC code link

Feelings

Hope you guys learnt something from the blog. Thank you for reading.

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

»
10 months ago, # |
  Vote: I like it +1 Vote: I do not like it

seems like this problem is the same as https://dmoj.ca/problem/ccoprep6p3