摘要: #include <iostream> #include <algorithm> using namespace std; int main() { int n, k; cin >> n >> k; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i 阅读全文
posted @ 2023-05-25 12:20 刘海烽 阅读(110) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int flag[10005]; //堆空间,默认初始化全是0,等价于 int flag[10005]={0}; //flag值为0表示没水塘,为1表示有水塘 int main(){ int n,m,k; //n,m,k 阅读全文
posted @ 2023-05-25 12:05 刘海烽 阅读(107) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int k, v, m; //v 顶点 k 边数 m 颜色种类 int ans; //记录最后答案 int col[1010]; //标记每个顶点所图颜色 int graph[1010][1010]; //二维数组存图 阅读全文
posted @ 2023-05-25 12:04 刘海烽 阅读(60) 评论(0) 推荐(0)
摘要: #include<iostream> #include<vector> #include<algorithm> using namespace std; vector<int>vd; vector<int>vn; int n; int minsize; int maxsize; int main() 阅读全文
posted @ 2023-05-25 12:00 刘海烽 阅读(126) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; char maze[8][8]; void dfs(int x, int y); void print() { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; 阅读全文
posted @ 2023-05-25 11:55 刘海烽 阅读(44) 评论(0) 推荐(0)
摘要: #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<vector> using namespace std; int par[105] = { 0 }; int rank0[105] = 阅读全文
posted @ 2023-05-25 11:43 刘海烽 阅读(69) 评论(0) 推荐(0)
摘要: #include<iostream> #include<vector> #include<algorithm> #define x first #define y second #define pll pair<int,int> using namespace std; int main() { v 阅读全文
posted @ 2023-05-23 15:04 刘海烽 阅读(120) 评论(0) 推荐(0)
摘要: /* * @Description: To iterate is human, to recurse divine. * @Autor: Recursion * @Date: 2022-05-16 22:59:39 * @LastEditTime: 2022-05-16 23:27:17 */ #i 阅读全文
posted @ 2023-05-23 15:03 刘海烽 阅读(62) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int arr[500010],temp[500010]; long long ans; //记录逆序的组数 //归并排序 void merge_sort(int arr[], int temp[], int left, 阅读全文
posted @ 2023-05-23 15:02 刘海烽 阅读(83) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; /* * 1 6 -45 22 42 -16 -41 -27 56 30 -36 53 -37 77 -36 30 -75 -46 26 -38 -10 62 -32 -54 -6 45 */ int main 阅读全文
posted @ 2023-05-23 15:01 刘海烽 阅读(81) 评论(0) 推荐(0)