摘要: 字符串处理经典题 1.CF219C Color Stripe(要求修改后的串中相邻字符不相同,求最少修改次数) Q: 给你一个长度为N 的字符串(由大写字母组成)和一个数量K,K是指可使用的不同的大写字母的个数。现要求修改源字符串,使得串中相邻的两个位置上的元素不同;一次只能更改一个字符,问你最少的 阅读全文
posted @ 2019-07-30 15:20 egoist的翻绳游戏 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 最短路扩展——分层图最短路 1 #include<algorithm> 2 #include<iostream> 3 #include<cstring> 4 #include<cstdio> 5 #include<vector> 6 #include<queue> 7 using namespace 阅读全文
posted @ 2019-07-27 21:44 egoist的翻绳游戏 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 图的强连通问题 ——求强连通分量个数,找出每个最大强连通子图。 三种算法,Tarjan、Kosaraju、Garbow。先说Tarjan。 Tarjan 1 #include<algorithm> 2 #include<iostream> 3 #include<cstring> 4 #include 阅读全文
posted @ 2019-07-27 10:24 egoist的翻绳游戏 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 第一场【cx】2019.7.19 第一题 (2019 ICPC 徐州 H.Rikka with A Long Colour Palette) Q:n条线段(每条线段给出左右边界位置[ l, r ]),k种颜色。你要为每条线段染一种颜色,问至少能被k种颜色所覆盖的区间的最大总长度。∑n <= 2e6, 阅读全文
posted @ 2019-07-22 22:55 egoist的翻绳游戏 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 第一场 1005.Path 多年后,杰瑞爱上了一个女孩,他经常走很长时间去看望她。但是,因为他花太多的时间和他的女朋友在一起,汤姆觉得被忽视了,想阻止他去看她。经过对小区的研究,Tom发现小区正好由n栋房屋组成,其中一些房屋与直路相连。去看望他的女朋友,杰瑞需要从他的房子1开始,沿着最短路径,到达n 阅读全文
posted @ 2019-07-22 22:23 egoist的翻绳游戏 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 第一场 E题:ABBA (类 卡特兰数) Bobo有一个长度为2(n + m)的字符串,由字符“A”和“B”组成。该字符串还具有迷人的特性:它可以分解为(n+ m)个长度为2的子序列,并且在(n+ m)个子序列中,它们中的n个子序列为“AB”,而其他m个为“BA”。 Q:现在给出n 和m ,请问你, 阅读全文
posted @ 2019-07-22 09:26 egoist的翻绳游戏 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1 #include<algorithm> 2 #include<cstring> 3 #include<cstdio> 4 using namespace std; 5 const int MAX_V= 510; 6 const int MAX_E= 60000; 7 const int INF= 阅读全文
posted @ 2019-07-18 10:52 egoist的翻绳游戏 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #include<queue> 6 using namespace std; 7 const int MAX_V = 1100; 8 阅读全文
posted @ 2019-07-18 10:24 egoist的翻绳游戏 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cstring> 5 #include<queue> 6 using namespace std; 7 const int MAX_V = 1100; 8 阅读全文
posted @ 2019-07-18 10:22 egoist的翻绳游戏 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 最短路练习 0. Til the Cows Come Home POJ - 2387 完美的模板题 1 //#include<Windows.h> 2 #include<iostream> 3 #include<algorithm> 4 #include<cstring> 5 #include<cs 阅读全文
posted @ 2019-05-26 19:20 egoist的翻绳游戏 阅读(207) 评论(0) 推荐(0) 编辑