摘要: 可以发现题目的重点是在第一个部分,因为只要信心值我们求出来了,那么第二问就是一个简单的最长上升子序列问题了,所以接下来只讲第一问。 阅读全文
posted @ 2018-05-29 20:45 蒟蒻JHY 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 考虑到最后a[i]都要等于i,并且每个 a[i] < i 的a[i] 一轮最多向前走一次,所以局数至少是 max{ i - a[i] }。 又因为对于a[i] < i来说,一轮不动意味着 a[i-1] < a[i] ,所以 i-1 - a[i-1] 是>= i - a[i] 的,所以要么该位置不是m 阅读全文
posted @ 2018-05-29 17:15 蒟蒻JHY 阅读(269) 评论(0) 推荐(0) 编辑
摘要: Discription You are given an undirected graph, constisting of n vertices and m edges. Each edge of the graph has some non-negative integer written on 阅读全文
posted @ 2018-05-29 10:36 蒟蒻JHY 阅读(296) 评论(0) 推荐(0) 编辑