1428. hofstadter G-sequenceTime Limit: 1000 MS Memory Limit: 65536 K Total Submissions: 228 (66 users) Accepted: 42 (39 users) [My Solution] DescriptionHofstadter G-sequence is an interesting series. However, due to the limited space, we will not introduce it in detail. In the following code, the requested function G (n) is the Hofstadter G-sequence series: int G (int n) {if (n <= 1) return 1; return n-G (n-1);} Of course, the requirement for this question is not to ask you to find the value of the function G (n), but to give you a positive integer x, you need to solve the problem. How many times does the above function need to call the function G (n) to calculate the value of G (x? Input has only one row, a positive integer x (1 <= x <= 1,000,000 ). Output because the answer may be large, you only need to Output the result after the modulo of the answer 1,000,000,007. Sample Input3Sample Output5Source For details, refer to the Code [cpp] # include <stdio. h> # include <string. h> int f [1000011], ans [1000011]; const int mod = 1000000007; void get () {int I, j; f [1] = 1; for (I = 2; I <= 1000000; I ++) {f [I] = I-f [f [I-1];} ans [1] = 1; for (I = 2; I <= 1000000; I ++) {ans [I] = (ans [I-1] % mod + ans [f [I-1] % mod + 1) % mod ;}} int main () {int I, j, m, n; get (); while (scanf ("% d", & n) = 1) {printf ("% d \ n ", ans [n]);} return 0 ;}