摘要:
题目链接 http://codeforces.com/problemset/problem/1027/D 这道题目的入手点就是图的特点。图的输入形式是 第 i 个点的后继是a[ i ],且只有一个,a[ i ]的范围是从1到n。所以图中一定存在环,并且环和环之间不可能公用一条边(如果共用一条边,那么 阅读全文
摘要:
题目链接http://noi.openjudge.cn/ch0206/1481/ 描述Given a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below: Your task is to calculat 阅读全文