
基础算法
大鳄梨12138
这个作者很懒,什么都没留下…
展开
-
cf1138B枚举
Polycarp is a head of a circus troupe. There are n — an even number — artists in the troupe. It is known whether the i-th artist can perform as a clown (if yes, then ci=1, otherwise ci=0), and whether they can perform as an acrobat (if yes, then ai=1, othe原创 2020-09-01 16:37:20 · 156 阅读 · 0 评论 -
前缀和差分处理区间更新单点查询模板
给定一个数组A,对其进行q次操作,每次给定l、r,对A【l-r】区间内所有数增加x,最后输出修改后每个数的值。前缀和+差分处理,时间复杂度O(n+q)。#include<iostream>#include<string>#include<cstring>#include<algorithm>using namespace std;int a[100010];//原数组 int d[100010];//差分数组 int sum[100010];原创 2020-05-15 11:44:24 · 305 阅读 · 0 评论