In hurry, I misread the "Good Subarrays" problems in Codeforces Round 825 (Div. 2) resulting in the following problems. The easy version is easier than the original easy, but I don't know if there is an $$$O(n)$$$ or $$$O(n\log n)$$$ algorithm for the corresponding hard version. I appreciate any hints towards $$$O(n)$$$ or $$$O(n\log n)$$$ algorithms.
New good arrays (easy version)
You are given an array $$$a = [a_1, \ldots, a_n]$$$. A position $$$i$$$ is good if $$$a_i \ge i$$$; a subarray $$$[a_{\ell},\ldots,a_r]$$$ is good if all the elements in the subarray are good. Find the number of good subarrays.
New good arrays (harder version)
Now you are, in addition, given $$$q$$$ updates to $$$a$$$, where $$$q \le n$$$. Unlike the original hard version, these updates are adaptive, i.e., they are not independent. Compute the number of good subarrays after each update. I claim that if the updates only increase the number, then again it is possible.