通过代码:
#include <bits/stdc++.h> using namespace std; int n, a[11], q[11][11], rate = 1, minn = 233; bool avl[11]; inline bool isPrime(int _a, int _b) { if(_a == 1 || _b == 1) return true; int _t = _a % _b; while(_t) _a = _b, _b = _t, _t = _a % _b; if(_b > 1) return false; else return true; } void dfs(int k, int r) { avl[k] = false; q[r][++ q[r][0]] = a[k]; bool fulled = true; for(int i = 1; i <= n; i ++) if(avl[i] == true) fulled = false; if(fulled == true) minn = rate < minn ? rate : minn; for(int i = 1; i <= n; i ++) if(avl[i]) { bool searched = false; for(int l = 1; l <= rate; l ++) { bool passed = true;
1221:分成互质组
最新推荐文章于 2023-12-20 14:10:06 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)