摘要:
链接:https://www.acwing.com/problem/content/1235/ 代码: #include<bits/stdc++.h> using namespace std; int k=0,n; char s[1005][1005]; int b[1005][1005]; int 阅读全文
摘要:
题目链接:https://www.acwing.com/problem/content/1226/ 思路:离散中的置换群概念,通过当前位置和最终要达到的位置构成环,计算环数k,需要交换的次数为n-k次 #include<bits/stdc++.h> using namespace std; int 阅读全文