摘要: 两次DFS求树中的最长路。基于邻接矩阵:代码:#include #include #include #include #include #include using namespace std;bool map[10001][10001];int n;int tail;bool vis[1001];... 阅读全文
posted @ 2015-02-02 19:45 我喜欢旅行 阅读(329) 评论(0) 推荐(0)
摘要: 路线冲突问题题目描述给出一张地图,地图上有n个点,任意两点之间有且仅有一条路。点的编号从1到n。现在兵团A要从s1到e1,兵团B要从s2到e2,问两条路线是否会有交点,若有则输出交点个数,否出输出”success”。输入多组输入。对于每组输入。第一行输入n(1#include #include #i... 阅读全文
posted @ 2015-02-02 15:26 我喜欢旅行 阅读(379) 评论(0) 推荐(0)
摘要: Black and white painting题目描述You are visiting the Centre Pompidou which contains a lot of modern paintings. In particular you notice one painting which... 阅读全文
posted @ 2015-02-02 08:53 我喜欢旅行 阅读(309) 评论(0) 推荐(0)
摘要: Annoying painting tool题目描述Maybe you wonder what an annoying painting tool is? First of all, the painting tool we speak of supports only black and whit... 阅读全文
posted @ 2015-02-02 08:24 我喜欢旅行 阅读(355) 评论(0) 推荐(0)