Little Artem has invented a time machine! He could go anywhere in time, but all his thoughts of course are with computer science. He wants to apply this time machine to a well-known data structure: multiset. Artem wants to create a basic multiset of…
题目传送门 题意:现在有3种操作, 1 t x 在t秒往multiset里面插入一个x 2 t x 在t秒从multiset里面删除一个x 3 t x 在t秒查询multiset里面有多少x 事情是按照输入顺序发生的,这个人有一个时光机,可以穿梭到那一秒去执行操作. 题解:CDQ分治.3维偏序,第一维是输入顺序,第二维t,然后直接map处理数据就好了. 代码: #include<bits/stdc++.h> using namespace std; #define Fopen freopen(…
Problem Description RD is a smart boy and excel in pinball game. However, playing common 2D pinball game for a great number of times results in accumulating tedium. Recently, RD has found a new type of pinball game, a 3D pinball game. The 3D pinball…