A - Longest k-Good Segment (尺取法)
题目链接:
https://cn.vjudge.net/contest/249801#problem/A
解题思路:尺取法,每次让尺子中包含k种不同的数,然后求最大。
代码:
#include<bits/stdc++.h>
using namespace std;
# define maxn 500000+10
# define inf 0x3f3f3f3f
int a[ma...
原创
2018-09-03 20:26:14 ·
191 阅读 ·
0 评论