摘要:
1 #include <bits/stdc++.h> 2 using namespace std; 3 const int N = 10010; 4 int d[N]; 5 int main(){ 6 int n, p, h, m; 7 set<pair<int, int>> existed; // 阅读全文
摘要:
1 #include <bits/stdc++.h> 2 using namespace std; 3 const int N = 5010; 4 int g[N][N]; 5 int main() { 6 int n, r; 7 cin >> n >> r; 8 int nn = r, mm = 阅读全文
摘要:
方法一:c++自带的next_permutation函数 1 #include <bits/stdc++.h> 2 using namespace std; 3 int a[15]; 4 int main() { 5 int n; 6 cin >> n; 7 for (int i = 0; i < 阅读全文
摘要:
方法一:dfs加剪枝 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int N = 30; 4 int n, m; 5 int way[N]; //方案 6 void dfs(int u, int start) { //u表示当前 阅读全文
摘要:
方法一:二进制状态枚举 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int N = 20; 4 int n; 5 int main() { 6 cin >> n; 7 for (int i = 0; i < (1 << n); 阅读全文