水题, Floyd一遍就完了. #include<cstdio> #include<algorithm> #define REP(i, a, b) for(int i = (a); i < (b); i++) using namespace std; const int MAXN = 101; int d[MAXN][MAXN], n; int main() { int u, v, kase = 0; while(~scanf("%d%d", &u…
A Ducci sequence is a sequence of n-tuples of integers. Given an n-tuple of integers (a1, a2, · · · , an), the next n-tuple in the sequence is formed by taking the absolute differences of neighboring integers: (a1, a2, · · · , an) → (|a1 − a2|, |a2 −…