Strongly connected Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4635 Description Give a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can…
Network of Schools Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 13800 Accepted: 5504 Description A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a li…
A =w= B QwQ C 题意:n个点m条边的无向图,其中有k个特殊点,你在这张图上尽可能多的连边,要求k个特殊点两两不连通,问最多能连多少边 分析:并查集 对原图做一次并查集,找出特殊点所在集合中节点数量最大的那个,将剩余没有特殊点的集合并到那个集合中去. 计算答案时候先根据集合的点数算出最大边数,再减去初始边数就是最多加的边数 D 题意:好像是个交互题,题目太长,不想看 分析:留坑 E 题意:Hongcow想去一家店买一些卡片,于是他和店主完了个游戏.每个回合,Hongcow选择做下面两件…
复杂度: O(len(a)+len(b)) 技巧及注意: 在匹配的时候记住先要自身匹配然后再匹配即可,同时边界问题不能忽略,处理好点吧. #include <cstdio> #include <cstring> using namespace std; const int N=10000; char a[N], b[N]; int p[N]; int main() { scanf("%s%s", a+1, b+1); int i, j, siza=strlen(…