CF69E
题意 给你n个数字 让你每次从第一个开始取m个长度为一段
输出这一段中最大的出现次数为1次的个数
拿到这道题先想到 对于这种取m个长度为一段的 那么我肯定是先取m个
然后跑一遍 删掉前面的 加入后面的 这样就类似一个动态取m个的过程了
因为数据是 1e9 所以我们首先离散化
离散化以后我们用线段树去维护一下区间minn
先让所有的区间minn都是无穷大
如果插入一个未出现过的数 那么这个数出现minn就是 1
如果不断插入就是++,如果去掉就是 –
然后减到0 要把他恢复成 0x3f3f3f3f
然后对于查找坐标 我们只要找最右边的比他大的下标即可
一发入魂 实属意外
/*
if you can't see the repay
Why not just work step by step
rubbish is relaxed
to ljq
*/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <cmath>
#include <map>
#include <stack>
#include <set>
#include <sstream>
#include <vector>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define dbg2(x1,x2) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<endl
#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<" "<<#x3<<" = "<<x3<<endl
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define lc (rt<<1)
#define rc (rt<<11)
#define mid ((l+r)>>1)
typedef pair<int,int> pll;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int _inf = 0xc0c0c0c0;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const ll _INF = 0xc0c0c0c0c0c0c0c0;
const ll mod = (int)1e9+7;
ll gcd(ll a,ll b){
return b?gcd(b,a%b):a;}
ll ksm(ll a,