当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6183:Color it

题目描述
Do you like painting? Little D doesn't like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy painting, Little D asks you to write a program to maintain following operations. The specific format of these operations is as follows.

$0$ : clear all the points.

$1$ $x$ $y$ $c$ : add a point which color is $c$ at point $(x,y)$.

$2$ $x$ $y_1$ $y_2$ : count how many different colors in the square $(1,y1)$ and $(x,y2)$. That is to say, if there is a point $(a,b)$ colored $c$, that $1 \leq a \leq x$ and $y_1 \leq b \leq y_2$, then the color $c$ should be counted.

$3$ : exit.
输入解释
The input contains many lines.

Each line contains a operation. It may be '0', '1 x y c' ( $1\leq x,y\leq 10^6,0\leq c \leq 50$ ), '2 x y1 y2' ($1\leq x,y_1,y_2\leq 10^6$ ) or '3'.

$x,y,c,y1,y2$ are all integers.

Assume the last operation is 3 and it appears only once.

There are at most $150000$ continuous operations of operation 1 and operation 2.

There are at most $10$ operation 0.

输出解释
For each operation 2, output an integer means the answer .
输入样例
0
1 1000000 1000000 50
1 1000000 999999 0
1 1000000 999999 0
1 1000000 1000000 49
2 1000000 1000000 1000000
2 1000000 1 1000000
0
1 1 1 1
2 1 1 2
1 1 2 2
2 1 1 2
1 2 2 2
2 1 1 2
1 2 1 3
2 2 1 2
2 10 1 2
2 10 2 2
0
1 1 1 1
2 1 1 1
1 1 2 1
2 1 1 2
1 2 2 1
2 1 1 2
1 2 1 1
2 2 1 2
2 10 1 2
2 10 2 2
3
输出样例
2
3
1
2
2
3
3
1
1
1
1
1
1
1
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6183

最后修改于 2020-10-25T23:29:06+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/10000MS(Java/Others) 132768/132768K(Java/Others)