摘要: https://www.patest.cn/contests/pat-a-practise/1022 直接模拟, 输入,按id排序,检索 #include <iostream> #include <string> #include <algorithm> using namespace std; s 阅读全文
posted @ 2016-11-22 18:12 demianzhang 阅读(457) 评论(0) 推荐(0) 编辑
摘要: https://www.patest.cn/contests/pat-a-practise/1030 找最短路,如果有多条找最小消耗的,相当于找两次最短路,可以直接dfs,数据小不会超时。 #include<cstdio> #include<string> #include<cstring> #in 阅读全文
posted @ 2016-11-22 17:31 demianzhang 阅读(342) 评论(0) 推荐(0) 编辑
摘要: https://www.patest.cn/contests/pat-a-practise/1018 先用Dijkstra算出最短路,然后二分答案来验证,顺便求出剩余最小,然后再从终点dfs回去求出路径 #include<cstdio> #include<string> #include<cstri 阅读全文
posted @ 2016-11-22 16:58 demianzhang 阅读(555) 评论(0) 推荐(0) 编辑