C - Vasya and String CodeForces - 676C #include<iostream> using namespace std; int main() { long long k,n; cin>>n>>k; string str; cin>>str; long long ...
分类:
其他好文 时间:
2020-04-18 15:28:20
阅读次数:
55
This is the hard version of the problem. The difference is the constraint on the sum of lengths of strings and the number of test cases. You can make ...
分类:
编程语言 时间:
2020-04-18 14:10:40
阅读次数:
87
"CodeForces 55D Beautiful numbers" 一句话题意:有T组询问,每次询问区间[l, r]中的beautiful number有多少。beautiful number是指这个数可以被组成它的数字整除。例如15是beautiful number,因为15可以被1整除,也可以 ...
分类:
其他好文 时间:
2020-04-17 18:39:23
阅读次数:
57
设计状态dp[i][j]表示T串Ti到Tj(区间i,j)匹配到的个数 由于T串比S串小,所以在区间(m,n)可以插入的字符串是任意的。 转移方程 if s[i] = t[l],dp[l][r] = dp[l][r] + dp[l+1][r] if s[i] = t[r] ,dp[l][r] = dp ...
分类:
其他好文 时间:
2020-04-17 12:35:45
阅读次数:
76
题意:给出a,b,c,d。从a~b~c~d三个区间内各找一个数,构成三角形。 解析:根据三角形的性质,输出a,c,c是一个可行解。记得从小到大输出,wa了1次。 #include<iostream> #include<vector> #include<cstring> using namespace ...
分类:
其他好文 时间:
2020-04-17 00:19:20
阅读次数:
74
In the wilds far beyond lies the Land of Sacredness, which can be viewed as a tree — connected undirected graph consisting of nn nodes and n?1n?1 edge ...
分类:
其他好文 时间:
2020-04-17 00:11:27
阅读次数:
66
``` #include #include #include #include using namespace std; const int N = 2e5+10; typedef long long ll; ll t, n1, n2, n3; ll a[N], b[N], c[N]; //分别固定... ...
分类:
其他好文 时间:
2020-04-16 20:55:59
阅读次数:
77
补题,参考博客:https://blog.csdn.net/qq_43676357/article/details/105559491?fps=1&locationNum=2 ...
分类:
其他好文 时间:
2020-04-16 20:54:41
阅读次数:
78
枚举第一个数x,根据第一个数找寻和它接近的第二个数y,再找寻和(x+y)/2接近的第三个数z。 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 using namespace std; 4 long long r[100007], ...
分类:
其他好文 时间:
2020-04-16 13:35:02
阅读次数:
64
题意: 一开始所有点都是花园 1为首都(即根) 现在n个点里弄k个工厂,而密探都在工厂点上 密探回首都时每经过一个花园时幸福度+1 密探一定走最短路 问最大幸福度之和 思路:BFS求出每个节点的深度,然后再减掉每个节点儿子所做的贡献,思路在代码中(DFS更简单) 代码: #include <iost ...
分类:
其他好文 时间:
2020-04-16 13:06:37
阅读次数:
72