HBC17339Chiaki Sequence Reloaded题解

庄子墨 算法基础篇 58 0
全网最全C++题库,助您快速提升编程技能!题库丰富多样,涵盖各个领域,让您在练习中不断成长!
a_n=begin{cases}0 & n = 1 \ a_{lfloor frac{n}{2} rfloor} + (-1)^{frac{n(n+1)}{2}} & n ge 2end{cases}. Chiaki would like to know the sum of the first n terms of the sequence, i.e.∣. As this number may be very large, Chiaki is only interested in its remainder modulo .

Chiaki is interested in an infinite sequence a1, a2, a3, ..., which defined as follows: a_n=begin{cases}0 & n = 1 \ a_{lfloor frac{n}{2} rfloor} + (-1)^{frac{n(n+1)}{2}} & n ge 2end{cases} a n ​ ={ a ⌊ 2 n ​ ⌋ ​ +(−1) 2 n(n+1) ​ ​ n=1 n≥2 ​ Chiaki would like to know the sum of the first n terms of the sequence, i.e. sumlimits_{i=1}^{n}|a_i| i=1 ∑ n ​ ∣a i ​ ∣. As this number may be very large, Chiaki is only interested in its remainder modulo (109 + 7).

HBC17339Chiaki Sequence Reloaded题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
全网最全C++题库,助您挑战自我,突破极限,成为编程领域的佼佼者!

标签: HBC17339Chiaki Sequence Reloaded题解