摘要:
给定长度为N的数列A,以及M条指令,指令为一下两种之一: 1. C L R d 表示把A[L],A[L+1].....A[R]都加上d 2. Q L R 表示查询 A[L]......A[R]的最大公约数 对于每个询问输出一个答案; 这个题算是经典的线段树的问题了,因为:区间修改+区间查询 这道题好 阅读全文
摘要:
Codeforces Round #781 C. Tree Infection time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A 阅读全文
摘要:
菜鸡第一次打icpc 记录一下历程 习惯#define int long long 以下皆是按照我认为的难易顺序排序 K. 看题意大概就是说求从L加到R 1 ios::sync_with_stdio(false); 2 cin.tie(nullptr); 3 cout.tie(nullptr); 4 阅读全文
摘要:
# include<iostream># include<cstring># include<algorithm>using namespace std;const int N = 200010;typedef long long ll;/* 树状数组的主要目的是利用树形结构来优化前缀和 使得前缀和 阅读全文