摘要: 题目链接:http://codeforces.com/problemset/problem/339/B题目理解不难,这句是解题的关键 In order to complete the i-th task, she needs to be in the house number ai and complete all tasks with numbers less than i 。从样例1的提示,可以知道,如果a[i]> a[i+1],则需要继续顺时针走下去,直到到达n,接着重新从1开始数,直到a[i+1]。 这里要注意的是题目中2 ≤ n ≤ 105, 1 ≤ m ≤ 105 ,暗示了我 阅读全文
posted @ 2013-08-28 14:09 windysai 阅读(408) 评论(0) 推荐(0) 编辑