上一页 1 ··· 26 27 28 29 30
摘要: #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int n; struct Range{ int l;int r; bool operator < (const Range & w)const { return r<w 阅读全文
posted @ 2023-04-25 21:41 艾鑫4646 阅读(11) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int N=110; double a[N][N]; const double eps = 1e-8; int n; int guess(){ int c, r; for (c = 0, r = 0 阅读全文
posted @ 2023-04-24 18:38 艾鑫4646 阅读(15) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<string> using namespace std; const int MAX=1000; struct Person { string m_Name;//姓名 int m_Sex;//性别 1为男 2为女 int m_Age; //年龄 阅读全文
posted @ 2023-04-23 20:12 艾鑫4646 阅读(16) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; const int N=20; int n; char g[N][N]; bool gs[N],unp[N],np[N]; void bhh(int u){ if(u==n){ for(int i=0;i<n;i++) 阅读全文
posted @ 2023-04-22 20:44 艾鑫4646 阅读(11) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N=1e5+10; int n,m; int h[N],e[N],ne[N],idx; int d[N];//入线 int 阅读全文
posted @ 2023-04-20 18:41 艾鑫4646 阅读(23) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; typedef long long LL; LL exgcd(LL a, LL b, LL &x, LL &y) { if (!b) { x = 1, y = 0; return a; } LL d = exg 阅读全文
posted @ 2023-04-19 19:33 艾鑫4646 阅读(21) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; const int N=100010; int p[N]; int find(int x){ if(p[x]!=x) p[x]=find(p[x]); return p[x]; } int main(){ int n,m 阅读全文
posted @ 2023-04-18 16:13 艾鑫4646 阅读(10) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int N=2010,mod=1e9+7; int c[N][N]; void inti(){ for(int i=0;i<N;i++){ for(int j=0;j<=i;j++){ if(j== 阅读全文
posted @ 2023-04-14 17:59 艾鑫4646 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 1.首先要想到排序问题中的归并排序来解决此问题; 其次我们要看逆序数的定义是i<j&&a[i]>a[j] ; 下面就来模拟一下; 1 3 2 4 7 8 9 5 6 7 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; 阅读全文
posted @ 2023-04-10 20:40 艾鑫4646 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 1.快速排序 思想:分治算法 三步骤:1.找一个分界值x; 2.将小于等于x的放在左边,将大于等于x的放在右边; 3。递归左右两边; #include<iostream> using namespace std; const int N=1e5+10; void quick_sort(int q[] 阅读全文
posted @ 2023-04-10 19:37 艾鑫4646 阅读(26) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30