HBC206675QueryTheoryI题解

八贝勒 结构体及应用 91 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。

XiaoYang is building a big system, which uses the pattern of Command Query Responsibility Segregation. This system holds an array of numbers {ai}lbrace a_i rbrace{ai​} of length n, where ai=ia_i = iai​=i for all i∈[1,n]i in [1, n]i∈[1,n]. And it is designed for a function f(L, R). f(L,R)=∑i=LR∑j∣ijf(L, R) = sum_{i=L}^R sum_{j|i} jf(L,R)=∑i=LR​∑j∣i​j You are developing this system with XiaoYang. Now, Q queries are here for the sequence with n=106n = 10^6n=106. Each query contains two number L, R. You should respond to these queries with the result of that function.

想要在职场中立于不败之地?那就来试试全网最全C++题库,让您在练习中快速提升技能。

标签: HBC206675QueryTheoryI题解