Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral poste ...
分类:
其他好文 时间:
2020-04-05 00:52:42
阅读次数:
87
参考 https://www.cnblogs.com/null00/archive/2012/04/22/2464876.html #include <stdio.h> #include <algorithm> #define LEN 10000 using namespace std; struc ...
分类:
其他好文 时间:
2020-02-11 20:48:58
阅读次数:
75
Mayor's posters(线段树+离散化+lazy) 题目大意:在墙上贴海报,然后很多海报,一层又一层,问你最后可以看到多少张海报。 题目分析:数据范围很大,普通的线段树肯定超时+超内存,所以要用到离散化,离散化有基础的和稍微复杂一点的,然后这题要用到稍微复杂一点的,离散化简单的来说就是只取我 ...
分类:
其他好文 时间:
2020-02-08 10:03:59
阅读次数:
63
题目传送门(内部题112) 输入格式 一个数$N$,表示矩形的个数。 接下来$N$行,每行四个整数$X_a,Y_a,X_b,Y_b$。分别表示每个矩形左下角和右上角的坐标。 保证$(X_a<X_b,Y_a<Y_b)$。 输出格式 一行,表示能看到的颜色数量。 样例 样例输入: 30 -1 1 12 ...
分类:
其他好文 时间:
2019-11-01 22:09:46
阅读次数:
132
主要思路是在离散化前把右端点++, 离散化后右端点-1. 1. CF 610D Vika and Segments 大意: 给定$n$条与坐标轴平行的线段, 求一共占了多少点 #include <iostream> #include <algorithm> #include <cstdio> #in ...
分类:
其他好文 时间:
2019-09-30 20:07:00
阅读次数:
85
题意:一个坐标轴从1~1e7,每次覆盖一个区间(li,ri),问最后可见区间有多少个(没有被其他区间挡住的) 线段树,按倒序考虑,贴上的地方记为1,每次看(li,ri)这个区间是否全是1,全是1就说明在它后面贴的把它给挡住了,否则该海报可见。 然后就愉快的MLE了。。。。 再看看数据范围,离散化如下 ...
分类:
其他好文 时间:
2019-09-28 20:19:53
阅读次数:
100
题目描述: 给你一个无限长的数组,初始的时候都为0,有3种操作: 操作1是把给定区间[l,r][l,r] 设为1, 操作2是把给定区间[l,r][l,r] 设为0, 操作3把给定区间[l,r][l,r] 0,1反转。 一共n个操作,每次操作后要输出最小位置的0。 题解: 经过分析观察,可以发现,答案 ...
分类:
其他好文 时间:
2019-08-19 19:18:09
阅读次数:
71
Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral poste ...
分类:
其他好文 时间:
2019-08-07 19:25:30
阅读次数:
99
Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral poste ...
分类:
其他好文 时间:
2019-08-06 10:40:19
阅读次数:
77
Mayor's posters Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 86160 Accepted: 24734 Description The citizens of Bytetown, AB, could not s ...
分类:
其他好文 时间:
2019-07-31 00:55:16
阅读次数:
121