摘要: 现代豪宅 题解 我们可以将每个有开关的点与起点终点离散化,再分别将每个点横向与竖向建成虚点,表示方向的转换,之间连接距离为1,把每行与每列的点用之间的差值作距离连接,建成一张图,跑一遍dijkstra即可。 源码 #include<cstdio> #include<cstring> #include 阅读全文
posted @ 2019-11-13 21:11 StaroForgin 阅读(7) 评论(0) 推荐(0)
摘要: 山峰和山谷 Ridges and Valleys 题解 一道简单的模拟,bfs搜索每个山峰与山谷即可。 源码 #include<cstdio> #include<cstring> #include<cmath> #include<iostream> #include<algorithm> #incl 阅读全文
posted @ 2019-11-13 21:04 StaroForgin 阅读(32) 评论(0) 推荐(0)