#include<cstdio> #include<algorithm> using namespace std; const int N=100000+3; int x[N], y[N], Y[N], A[N], nums[N]; int C[N]; int cmp(int i,int j){ if(x[i]==x[j])return y[i]<y[j]; return x[i]<x[j]; } int lowbit(int t){return t&(-t);…
树状数组维护DP + 高精度 Description These days, Sempr is crazed on one problem named Crazy Thair. Given N (1 ≤ N ≤ 50000) numbers, which are no more than 109, Crazy Thair is a group of 5 numbers {i, j, k, l, m} satisfying: 1 ≤ i < j < k < l < m ≤ N Ai…
Bobo has a balanced parenthesis sequence P=p 1 p 2…p n of length n and q questions. The i-th question is whether P remains balanced after p ai and p bi swapped. Note that questions are individual so that they have no affect on others. Parenthesis se…
题目描述 这是一道模板题,其数据比「普通平衡树」更强. 如未特别说明,以下所有数据均为整数. 维护一个多重集 S ,初始为空,有以下几种操作: 把 x 加入 S 删除 S 中的一个 x,保证删除的 x 一定存在 求 S 中第 k 小 求 S 中有多少个元素小于 x 求 S 中小于 x 的最大数 求 S 中大于 x 的最小数 操作共 n 次. 输入格式 第一行一个整数 n,表示共有 n 次操作 . 接下来 n 行,每行为以下几种格式之一 : 0 x,把 x 加入 S 1 x,删除 S 中的一个 x…
任意门:https://nanti.jisuanke.com/t/31459 There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xx , yy ) means the wave is a rectangle whose vertexes are ( 00 , 00 ), ( xx , 00 ), ( 00 , yy ), ( xx , yy ). Every ti…
题目传送门:http://codeforces.com/contest/799/problem/C C. Fountains time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Arkady plays Gardenscapes a lot. Arkady wants to build two new fountains. T…
题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6447 YJJ's Salesman Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 919 Accepted Submission(s): 290 Problem Description YJJ is a salesman who h…