题意转化 我们把它想象成一张图,给你的是a>b,我们就从b向a连一条边,最后的时候每次以i结点遍历整张图。看看能遍历到几个点就行了,最后的时候答案要-1.因为第i个点也算了一遍。 code #include <bits/stdc++.h> #define N 100010 #define M 2010 using namespace std; int n, m, head[M], add_edge, vis[M], ans; struct node { int next, to; }edge[M]; int read() { int s = 0, f = ...