codecraft专题

Codeforces Round 940 (Div. 2) and CodeCraft-23 D. A BIT of an Inequality

A BIT of an Inequality 题目描述 给你一个数组 a 1 , a 2 , … , a n a_1, a_2, \ldots, a_n a1​,a2​,…,an​ 。求这样的图元( x , y , z x, y, z x,y,z )的个数: 1 ≤ x ≤ y ≤ z ≤ n 1 \leq x \leq y \leq z \leq n 1≤x≤y≤z≤n , 和 f

Codecraft-18 and Codeforces Round #458 D. Bash and a Tough Math Puzzle(线段树)

Bash likes playing with arrays. He has an array a1, a2, ... an of n integers. He likes to guess the greatest common divisor (gcd) of different segments of the array. Of course, sometimes the guess