Description During a discussion of problems at the Petrozavodsk Training Camp, Vova and Sasha argued about who of them could in 300 minutes find a pair of equal squares of the maximal size in a matrix of size N × M containing lowercase English letter…
模板题,,,模板打错查了1h+QAQ #include<cmath> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N = 1000003; int t1[N], t2[N], c[N], f[N][30]; void st(int *x, int *y, int *sa, int n, int m) { int i; for(i =…
题目 #include<cstdio> #include<algorithm> using namespace std; #define N 1005 int n, m, cnt; int a[N], b[N], dp[N]; //dp[i]表示到a[i]大的怪物都死最少要多少个spell int main() { scanf("%d%d", &n, &m); for(int i = 1; i <= n; i++) { scanf(&quo…
Description You have a string and queries of two types: replace i'th character of the string by character a; check if substring sj...sk is a palindrome. Input The first line contains a string consisting of n small English letters. The second line con…
During a discussion of problems at the Petrozavodsk Training Camp, Vova and Sasha argued about who of them could in 300 minutes find a pair of equal squares of the maximal size in a matrix of size N × M containing lowercase English letters. Squares c…