题目传送门:http://codeforces.com/contest/1119/problem/D D. Frets On Fire time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output Miyako came to the flea kingdom with a ukulele. She became good friend…
题目分析: 用"$"连接后缀数组,然后做一个主席树求区间内不同的数的个数.二分一个前缀长度再在主席树上求不同的数的个数. 代码: #include<bits/stdc++.h> using namespace std; ; ; int m,n,k; string hmk[maxn],str; int sum[maxn]; int sa[maxn],rk[maxn],X[maxn],Y[maxn]; ],Tnum; long long ans[maxn]; struct no…
Description A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the subsequence of consecutive elements o…