A - Poisonous Cookies

有毒还吃,有毒吧

  1. #include <bits/stdc++.h>
  2. #define fi first
  3. #define se second
  4. #define pii pair<int,int>
  5. #define mp make_pair
  6. #define pb push_back
  7. #define space putchar(' ')
  8. #define enter putchar('\n')
  9. #define MAXN 100005
  10. #define eps 1e-10
  11. //#define ivorysi
  12. using namespace std;
  13. typedef long long int64;
  14. typedef double db;
  15. template<class T>
  16. void read(T &res) {
  17. res = 0;T f = 1;char c = getchar();
  18. while(c < '0' || c > '9') {
  19. if(c == '-') f = -1;
  20. c = getchar();
  21. }
  22. while(c >= '0' && c <= '9') {
  23. res = res * 10 + c - '0';
  24. c = getchar();
  25. }
  26. res *= f;
  27. }
  28. template<class T>
  29. void out(T x) {
  30. if(x < 0) {x = -x;putchar('-');}
  31. if(x >= 10) {
  32. out(x / 10);
  33. }
  34. putchar('0' + x % 10);
  35. }
  36. int64 A,B,C;
  37. void Solve() {
  38. read(A);read(B);read(C);
  39. out(B + min(C,A + B + 1));enter;
  40. }
  41. int main() {
  42. #ifdef ivorysi
  43. freopen("f1.in","r",stdin);
  44. #endif
  45. Solve();
  46. }

B - Tree Burning

我们枚举一个断点,也就是前\(i\)个是顺时针走的,后\(N - i\)个是逆时针走的

发现相当于左边选后t个点,右边选后t + 1个点(t <= i && t + 1 <= N - i)

(或者左边后t + 1个,右t个,和这个情况类似)

然后这些点到原点的距离乘二,再减去右边最后一个点到原点的距离

是这种情况能到达的最大值

  1. #include <bits/stdc++.h>
  2. #define fi first
  3. #define se second
  4. #define pii pair<int,int>
  5. #define mp make_pair
  6. #define pb push_back
  7. #define space putchar(' ')
  8. #define enter putchar('\n')
  9. #define MAXN 200005
  10. #define eps 1e-10
  11. //#define ivorysi
  12. using namespace std;
  13. typedef long long int64;
  14. typedef double db;
  15. template<class T>
  16. void read(T &res) {
  17. res = 0;T f = 1;char c = getchar();
  18. while(c < '0' || c > '9') {
  19. if(c == '-') f = -1;
  20. c = getchar();
  21. }
  22. while(c >= '0' && c <= '9') {
  23. res = res * 10 + c - '0';
  24. c = getchar();
  25. }
  26. res *= f;
  27. }
  28. template<class T>
  29. void out(T x) {
  30. if(x < 0) {x = -x;putchar('-');}
  31. if(x >= 10) {
  32. out(x / 10);
  33. }
  34. putchar('0' + x % 10);
  35. }
  36. int64 L;int N;
  37. int64 a[MAXN],sum[2][MAXN];
  38. void Solve() {
  39. read(L);read(N);
  40. for(int i = 1 ; i <= N ; ++i) read(a[i]);
  41. for(int i = 1 ; i <= N ; ++i) {
  42. sum[0][i] = sum[0][i - 1] + a[i];
  43. }
  44. for(int i = N ; i >= 1 ; --i) {
  45. sum[1][i] = sum[1][i + 1] + L - a[i];
  46. }
  47. int64 ans = max(L - a[1],a[N]);
  48. for(int i = 1 ; i <= N - 1; ++i) {
  49. int t = min(i,N - i);
  50. int64 res = 2 * (sum[0][i] - sum[0][i - t] + sum[1][i + 1] - sum[1][i + 1 + t]);
  51. int64 c = res - a[i];
  52. if(i > t) {c += 2 * a[i - t];}
  53. ans = max(ans,c);
  54. c = res - (L - a[i + 1]);
  55. if(N - i > t) c += 2 * (L - a[i + 1 + t]);
  56. ans = max(ans,c);
  57. }
  58. out(ans);enter;
  59. }
  60. int main() {
  61. #ifdef ivorysi
  62. freopen("f1.in","r",stdin);
  63. #endif
  64. Solve();
  65. }

C - Coloring Torus

我构造水平低啊。。。

这题是如果\(K\)是4的倍数,很好做

就是这么填,如果是4 * 4

而且标号认为是\(0-K - 1\)

0 1 2 3

5 6 7 4

2 3 0 1

7 4 5 6

如果要减少一个数,我们把\(i + n\)都替换成\(i\)即可。。。

  1. #include <bits/stdc++.h>
  2. #define fi first
  3. #define se second
  4. #define pii pair<int,int>
  5. #define mp make_pair
  6. #define pb push_back
  7. #define space putchar(' ')
  8. #define enter putchar('\n')
  9. #define MAXN 200005
  10. #define eps 1e-10
  11. //#define ivorysi
  12. using namespace std;
  13. typedef long long int64;
  14. typedef double db;
  15. template<class T>
  16. void read(T &res) {
  17. res = 0;T f = 1;char c = getchar();
  18. while(c < '0' || c > '9') {
  19. if(c == '-') f = -1;
  20. c = getchar();
  21. }
  22. while(c >= '0' && c <= '9') {
  23. res = res * 10 + c - '0';
  24. c = getchar();
  25. }
  26. res *= f;
  27. }
  28. template<class T>
  29. void out(T x) {
  30. if(x < 0) {x = -x;putchar('-');}
  31. if(x >= 10) {
  32. out(x / 10);
  33. }
  34. putchar('0' + x % 10);
  35. }
  36. int K;
  37. int a[505][505],N;
  38. void Solve() {
  39. read(K);
  40. if(K == 1) {
  41. puts("1");puts("1");return;
  42. }
  43. for(int i = 2 ; i <= 500 ; i += 2) {
  44. if(2 * i >= K) {N = i;break;}
  45. }
  46. for(int i = 0 ; i < N ; ++i) {
  47. for(int j = 0 ; j < N ; ++j) {
  48. if(i & 1) a[i][j] = ((i + j) % N) + N;
  49. else a[i][j] = (i + j) % N;
  50. }
  51. }
  52. int p = N - 1;
  53. while(K < 2 * N) {
  54. for(int i = 0 ; i < N ; ++i) {
  55. for(int j = 0 ; j < N ; ++j) {
  56. if(a[i][j] == p + N) a[i][j] = p;
  57. }
  58. }
  59. --p;
  60. ++K;
  61. }
  62. out(N);enter;
  63. for(int i = 0 ; i < N ; ++i) {
  64. for(int j = 0 ; j < N ; ++j) {
  65. out(a[i][j] + 1);space;
  66. }
  67. enter;
  68. }
  69. }
  70. int main() {
  71. #ifdef ivorysi
  72. freopen("f1.in","r",stdin);
  73. #endif
  74. Solve();
  75. }

D - Inversion Sum

这题好神仙啊QAQ

对于这种一脸计数的题,sd选手只会上去想计数,然而这题转成概率做,非常妙

\(dp[t][i][j]\)表示第\(t\)次操作第\(i\)个位置大于第\(j\)个位置的方案数

每次转移影响4n个位置

然后直接统计期望,最后乘上\(2^Q\)就是答案

  1. #include <bits/stdc++.h>
  2. #define fi first
  3. #define se second
  4. #define pii pair<int,int>
  5. #define mp make_pair
  6. #define pb push_back
  7. #define space putchar(' ')
  8. #define enter putchar('\n')
  9. #define MAXN 200005
  10. #define eps 1e-10
  11. //#define ivorysi
  12. using namespace std;
  13. typedef long long int64;
  14. typedef double db;
  15. template<class T>
  16. void read(T &res) {
  17. res = 0;T f = 1;char c = getchar();
  18. while(c < '0' || c > '9') {
  19. if(c == '-') f = -1;
  20. c = getchar();
  21. }
  22. while(c >= '0' && c <= '9') {
  23. res = res * 10 + c - '0';
  24. c = getchar();
  25. }
  26. res *= f;
  27. }
  28. template<class T>
  29. void out(T x) {
  30. if(x < 0) {x = -x;putchar('-');}
  31. if(x >= 10) {
  32. out(x / 10);
  33. }
  34. putchar('0' + x % 10);
  35. }
  36. const int MOD = 1000000007;
  37. int inc(int a,int b) {
  38. return a + b >= MOD ? a + b - MOD : a + b;
  39. }
  40. int mul(int a,int b) {
  41. return 1LL * a * b % MOD;
  42. }
  43. int fpow(int x,int c) {
  44. int res = 1,t = x;
  45. while(c) {
  46. if(c & 1) res = mul(res,t);
  47. t = mul(t,t);
  48. c >>= 1;
  49. }
  50. return res;
  51. }
  52. int N,Q,Inv2;
  53. int dp[3005][3005],f[3005][3005];
  54. int A[3005];
  55. void Solve() {
  56. Inv2 = (MOD + 1) / 2;
  57. read(N);read(Q);
  58. for(int i = 1 ; i <= N ; ++i) read(A[i]);
  59. for(int i = 1 ; i <= N ; ++i) {
  60. for(int j = 1 ; j <= N ; ++j) {
  61. if(A[i] > A[j]) dp[i][j] = 1;
  62. }
  63. }
  64. int x,y;
  65. for(int i = 1 ; i <= Q ; ++i) {
  66. read(x);read(y);
  67. for(int j = 1 ; j <= N ; ++j) {
  68. f[x][j] = dp[x][j];
  69. f[j][x] = dp[j][x];
  70. f[j][y] = dp[j][y];
  71. f[y][j] = dp[y][j];
  72. }
  73. for(int j = 1 ; j <= N ; ++j) {
  74. if(j != x && j != y)
  75. dp[x][j] = mul(Inv2,inc(f[x][j],f[y][j]));
  76. dp[j][x] = mul(Inv2,inc(f[j][x],f[j][y]));
  77. dp[y][j] = mul(Inv2,inc(f[y][j],f[x][j]));
  78. dp[j][y] = mul(Inv2,inc(f[j][y],f[j][x]));
  79. }
  80. dp[x][y] = mul(Inv2,inc(f[x][y],f[y][x]));
  81. dp[y][x] = mul(Inv2,inc(f[y][x],f[x][y]));
  82. }
  83. int ans = 0;
  84. for(int i = 1 ; i <= N ; ++i) {
  85. for(int j = i + 1 ; j <= N ; ++j) {
  86. ans = inc(ans,dp[i][j]);
  87. }
  88. }
  89. ans = mul(ans,fpow(2,Q));
  90. out(ans);enter;
  91. }
  92. int main() {
  93. #ifdef ivorysi
  94. freopen("f1.in","r",stdin);
  95. #endif
  96. Solve();
  97. }

E - Less than 3

题解的图画的挺好的,就不照搬了

就是在\(01\)和\(10\)之间画一条线,发现就是这些线不停的移动,我们枚举某条线和哪条线匹配,让后往两边扩展,最多匹配就N种

  1. #include <bits/stdc++.h>
  2. #define fi first
  3. #define se second
  4. #define pii pair<int,int>
  5. #define mp make_pair
  6. #define pb push_back
  7. #define space putchar(' ')
  8. #define enter putchar('\n')
  9. #define MAXN 200005
  10. #define eps 1e-10
  11. //#define ivorysi
  12. using namespace std;
  13. typedef long long int64;
  14. typedef double db;
  15. template<class T>
  16. void read(T &res) {
  17. res = 0;T f = 1;char c = getchar();
  18. while(c < '0' || c > '9') {
  19. if(c == '-') f = -1;
  20. c = getchar();
  21. }
  22. while(c >= '0' && c <= '9') {
  23. res = res * 10 + c - '0';
  24. c = getchar();
  25. }
  26. res *= f;
  27. }
  28. template<class T>
  29. void out(T x) {
  30. if(x < 0) {x = -x;putchar('-');}
  31. if(x >= 10) {
  32. out(x / 10);
  33. }
  34. putchar('0' + x % 10);
  35. }
  36. const int MOD = 1000000007;
  37. int inc(int a,int b) {
  38. return a + b >= MOD ? a + b - MOD : a + b;
  39. }
  40. int mul(int a,int b) {
  41. return 1LL * a * b % MOD;
  42. }
  43. int fpow(int x,int c) {
  44. int res = 1,t = x;
  45. while(c) {
  46. if(c & 1) res = mul(res,t);
  47. t = mul(t,t);
  48. c >>= 1;
  49. }
  50. return res;
  51. }
  52. int N,st[2],ed[2];
  53. char s[5005],t[5005];
  54. vector<int> a,b;
  55. void Init() {
  56. read(N);
  57. scanf("%s%s",s + 1,t + 1);
  58. for(int i = 1 ; i <= 10010 ; ++i) {
  59. a.pb(0);b.pb(0);
  60. }
  61. if(s[1] == '0') a.pb(0);
  62. if(t[1] == '0') b.pb(0);
  63. st[0] = a.size() - 1;st[1] = b.size() - 1;
  64. for(int i = 1 ; i < N ; ++i) {
  65. if(s[i] != s[i + 1]) a.pb(i);
  66. if(t[i] != t[i + 1]) b.pb(i);
  67. }
  68. ed[1] = b.size();
  69. for(int i = 1 ; i <= 10010 ; ++i) {
  70. a.pb(N);b.pb(N);
  71. }
  72. }
  73. void Solve() {
  74. int p = st[0] - 2,q = ed[1] + 2;
  75. if((p & 1) != (q & 1)) ++q;
  76. int ans = N * N;
  77. while(q >= st[1] - N - 2) {
  78. int t0 = p + 1,t1 = q + 1;
  79. int res = abs(a[p] - b[q]);
  80. while(a[t0] != N || b[t1] != N) {
  81. res += abs(a[t0] - b[t1]);
  82. ++t0;++t1;
  83. }
  84. t0 = p - 1,t1 = q - 1;
  85. while(a[t0] != 0 || b[t1] != 0) {
  86. res += abs(a[t0] - b[t1]);
  87. --t0;--t1;
  88. }
  89. ans = min(ans,res);
  90. q -= 2;
  91. }
  92. out(ans);enter;
  93. }
  94. int main() {
  95. #ifdef ivorysi
  96. freopen("f1.in","r",stdin);
  97. #endif
  98. Init();
  99. Solve();
  100. }

F - Permutation and Minimum

看出来类似一个卡特兰数的前后匹配,发现正着做就是不行,结果反着推就对了。。。看来正推复杂度堪忧就得试试反着

显然可以把两个位置都填上数的位置全部删掉,不影响答案

现在默认任意\(2i,2i+1\)两个位置没有填上数

设一对位置都是空的个数是\(cnt\),我们计算数互不相同的b序列有多个,答案再乘上\(cnt!\)

然后\(f[n][j][k]\)表示从2N到n,有j个没有在给出的A序列里的数出现过的数被钦定成了较大的一方,有k个在A序列里出现过的数被钦定成了较大的一方

转移的话,如果\(n\)在A中出现过就是

\(f[n][j][k + 1] \leftarrow f[n + 1][j][k]\)

\(f[n][j - 1][k] \leftarrow f[n + 1][j][k]\)

如果\(n\)没出现过就是

\(f[n][j][k - 1] \leftarrow f[n + 1][j][k] * k\)

\(f[n][j + 1][k] \leftarrow f[n + 1][j][k]\)

\(f[n][j - 1][k] \leftarrow f[n + 1][j][k]\)

  1. #include <bits/stdc++.h>
  2. #define fi first
  3. #define se second
  4. #define pii pair<int,int>
  5. #define mp make_pair
  6. #define pb push_back
  7. #define space putchar(' ')
  8. #define enter putchar('\n')
  9. #define MAXN 200005
  10. #define eps 1e-10
  11. //#define ivorysi
  12. using namespace std;
  13. typedef long long int64;
  14. typedef double db;
  15. template<class T>
  16. void read(T &res) {
  17. res = 0;T f = 1;char c = getchar();
  18. while(c < '0' || c > '9') {
  19. if(c == '-') f = -1;
  20. c = getchar();
  21. }
  22. while(c >= '0' && c <= '9') {
  23. res = res * 10 + c - '0';
  24. c = getchar();
  25. }
  26. res *= f;
  27. }
  28. template<class T>
  29. void out(T x) {
  30. if(x < 0) {x = -x;putchar('-');}
  31. if(x >= 10) {
  32. out(x / 10);
  33. }
  34. putchar('0' + x % 10);
  35. }
  36. const int MOD = 1000000007;
  37. int N,dp[2][605][605],C[606][606],fac[606];
  38. int A[605],cnt;
  39. bool vis[605],used[605];
  40. int inc(int a,int b) {
  41. return a + b >= MOD ? a + b - MOD : a + b;
  42. }
  43. int mul(int a,int b) {
  44. return 1LL * a * b % MOD;
  45. }
  46. void update(int &x,int y) {
  47. x = inc(x,y);
  48. }
  49. void Init() {
  50. read(N);
  51. for(int i = 1 ; i <= 2 * N ; ++i) read(A[i]);
  52. cnt = 0;
  53. for(int i = 1 ; i <= N ; ++i) {
  54. if(A[2 * i] == -1 && A[2 * i - 1] == -1) ++cnt;
  55. if(A[2 * i] != -1 && A[2 * i - 1] != -1) {
  56. vis[A[2 * i]] = vis[A[2 * i - 1]] = 1;
  57. }
  58. else if(A[2 * i] != -1) used[A[2 * i]] = 1;
  59. else if(A[2 * i - 1] != -1) used[A[2 * i - 1]] = 1;
  60. }
  61. C[0][0] = 1;
  62. for(int i = 1 ; i <= 2 * N ; ++i) {
  63. C[i][0] = 1;
  64. for(int j = 1 ; j <= i ; ++j) {
  65. C[i][j] = inc(C[i - 1][j - 1],C[i - 1][j]);
  66. }
  67. }
  68. fac[0] = 1;
  69. for(int i = 1 ; i <= 2 * N ; ++i) fac[i] = mul(fac[i - 1],i);
  70. }
  71. void Solve() {
  72. int cur = 0;
  73. dp[0][0][0] = 1;
  74. for(int i = 2 * N ; i >= 1 ; --i) {
  75. if(vis[i]) continue;
  76. memset(dp[cur ^ 1],0,sizeof(dp[cur ^ 1]));
  77. int t = (2 * N) - i;
  78. if(used[i]) {
  79. for(int j = 0 ; j <= t ; ++j) {
  80. for(int k = 0 ; k <= t - j ; ++k) {
  81. if(dp[cur][j][k]) {
  82. update(dp[cur ^ 1][j][k + 1],dp[cur][j][k]);
  83. if(j) update(dp[cur ^ 1][j - 1][k],dp[cur][j][k]);
  84. }
  85. }
  86. }
  87. }
  88. else {
  89. for(int j = 0 ; j <= t ; ++j) {
  90. for(int k = 0 ; k <= t - j ; ++k) {
  91. if(dp[cur][j][k]) {
  92. update(dp[cur ^ 1][j + 1][k],dp[cur][j][k]);
  93. if(k) update(dp[cur ^ 1][j][k - 1],mul(k,dp[cur][j][k]));
  94. if(j) update(dp[cur ^ 1][j - 1][k],dp[cur][j][k]);
  95. }
  96. }
  97. }
  98. }
  99. cur ^= 1;
  100. }
  101. int ans = dp[cur][0][0];
  102. ans = mul(ans,fac[cnt]);
  103. out(ans);enter;
  104. }
  105. int main() {
  106. #ifdef ivorysi
  107. freopen("f1.in","r",stdin);
  108. #endif
  109. Init();
  110. Solve();
  111. }

【AtCoder】AGC030的更多相关文章

  1. 【AtCoder】ARC092 D - Two Sequences

    [题目]AtCoder Regular Contest 092 D - Two Sequences [题意]给定n个数的数组A和数组B,求所有A[i]+B[j]的异或和(1<=i,j<=n ...

  2. 【Atcoder】CODE FESTIVAL 2017 qual A D - Four Coloring

    [题意]给定h,w,d,要求构造矩阵h*w满足任意两个曼哈顿距离为d的点都不同色,染四色. [算法]结论+矩阵变换 [题解] 曼哈顿距离是一个立着的正方形,不方便处理.d=|xi-xj|+|yi-yj ...

  3. 【AtCoder】ARC 081 E - Don't Be a Subsequence

    [题意]给定长度为n(<=2*10^5)的字符串,求最短的字典序最小的非子序列字符串. http://arc081.contest.atcoder.jp/tasks/arc081_c [算法]字 ...

  4. 【AtCoder】AGC022 F - Leftmost Ball 计数DP

    [题目]F - Leftmost Ball [题意]给定n种颜色的球各k个,每次以任意顺序排列所有球并将每种颜色最左端的球染成颜色0,求有多少种不同的颜色排列.n,k<=2000. [算法]计数 ...

  5. 【AtCoder】AGC005 F - Many Easy Problems 排列组合+NTT

    [题目]F - Many Easy Problems [题意]给定n个点的树,定义S为大小为k的点集,则f(S)为最小的包含点集S的连通块大小,求k=1~n时的所有点集f(S)的和取模92484403 ...

  6. 【AtCoder】ARC067 F - Yakiniku Restaurants 单调栈+矩阵差分

    [题目]F - Yakiniku Restaurants [题意]给定n和m,有n个饭店和m张票,给出Ai表示从饭店i到i+1的距离,给出矩阵B(i,j)表示在第i家饭店使用票j的收益,求任选起点和终 ...

  7. 【AtCoder】ARC095 E - Symmetric Grid 模拟

    [题目]E - Symmetric Grid [题意]给定n*m的小写字母矩阵,求是否能通过若干行互换和列互换使得矩阵中心对称.n,m<=12. [算法]模拟 [题解]首先行列操作独立,如果已确 ...

  8. 【Atcoder】AGC022 C - Remainder Game 搜索

    [题目]C - Remainder Game [题意]给定n个数字的序列A,每次可以选择一个数字k并选择一些数字对k取模,花费2^k的代价.要求最终变成序列B,求最小代价或无解.n<=50,0& ...

  9. 【Atcoder】AGC 020 B - Ice Rink Game 递推

    [题意]n个人进行游戏,每轮只保留最大的a[i]倍数的人,最后一轮过后剩余2人,求最小和最大的n,或-1.n<=10^5. [算法]递推||二分 [题解]令L(i),R(i)表示第i轮过后的最小 ...

随机推荐

  1. bzoj1098 办公楼

    Description FGD开办了一家电话公司.他雇用了N个职员,给了每个职员一部手机.每个职员的手机里都存储有一些同事的电话号码.由于FGD的公司规模不断扩大,旧的办公楼已经显得十分狭窄,FGD决 ...

  2. 《剑指offer》— JavaScript(28)数组中出现次数超过一半的数字

    数组中出现次数超过一半的数字 题目描述 数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字.例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}.由于数字2在数组中出现了5次,超 ...

  3. C/C++ 类成员函数指针 类成员数据指针

    普通函数指针:  "return_type (*ptr_name)(para_types) " 类成员函数指针: "return_type (class_name::*p ...

  4. python学习(26)分析ajax请求抓取今日头条cosplay小姐姐图片

    分析ajax请求格式,模拟发送http请求,从而获取网页代码,进而分析取出需要的数据和图片.这里分析ajax请求,获取cosplay美女图片. 登陆今日头条,点击搜索,输入cosplay 下面查看浏览 ...

  5. JavaScript--序列化以及转义

    一.序列化 1.1 序列化 将其他对象转换为字符串,用法:JSON.stringify() var li = [1,2,3,4]; var new_li = JSON.stringify(li); n ...

  6. python数据分析Numpy(二)

    Numpy (Numerical Python) 高性能科学计算和数据分析的基础包: ndarray,多维数组(矩阵),具有矢量运算能力,快速.节省空间: 矩阵运算,无需循环,可以完成类似Matlab ...

  7. websocket使用nginx作为反向代理

    需要nginx作为websocket的反向代理,没有nginx反向代理时候没有问题,通过nginx反向代理后会报400错误,查后台调试信息: tornado.general – DEBUG – Can ...

  8. python---django使用数据库(orm)

    官方教程点击此处 项目默认使用sqlite DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os. ...

  9. 如何通过卡面标识区分SD卡的速度等级

    现在很多设备都可以插存储卡,而比较流行的就是SD(Secure Digital Memory Card)卡和Micro SD(原名TF,Trans-flash Card )卡,这两种卡主要就是尺寸不同 ...

  10. HDU 5299 圆扫描线 + 树上删边

    几何+博弈的简单组合技 给出n个圆,有包含关系,以这个关系做游戏,每次操作可以选择把一个圆及它内部的圆全部删除,不能操作者输. 圆的包含关系显然可以看做是树型结构,所以也就是树上删边的游戏. 而找圆的 ...