摘要:
、 这道题可以看成是一个最长路,用拓扑+dp来解决。 如果从边上绕一个点到达目的地能挖到的地雷比直接过去挖到的地雷多,就选择从边上绕 ####代码: #include <bits/stdc++.h> using namespace std; int head[1000001]; int a[1000 阅读全文
摘要:
#解析 通过画图分析不难得到:首先我们对其中一个河岸从小到大排序,然后在另一个河岸中求出最长上升自序列即可。为什么这么写呢?因为爱情 因为所有合法的答案都是一个单调上升队列。 #代码: #include #include using namespace std; struct river { int 阅读全文