题目链接:uva 10587 - Mayor's posters
题目大意:就是有一个长度为n的公告板,每次在区间l,r上贴一张海报,问说最后还能看到几张不同的海报。
解题思路:线段树,区间更新,最后统计一下整段区间有多少种不同的海报。
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 20005;
#define lson(x) ((x)<<1)
#define rson(x) (((x)<<1)+1)
struct Node {
int l, r, v, s;
void set(int l, int r, int v, int......
阅读全文