会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小白QIU
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
下一页
2022年3月13日
最长上升子序列
摘要: ##### #include <iostream>#include <algorithm>using namespace std;const int N=1010;int n;int a[N],f[N],res;int main(){ cin>>n; for(int i=1;i<=n;i++) ci
阅读全文
posted @ 2022-03-13 08:16 小白QIU
阅读(22)
评论(0)
推荐(0)
2022年3月12日
数字三角形
摘要: #### #include <iostream>#include <stdio.h>#include <algorithm>using namespace std;const int N=510,INF=1e9;int n;int a[N][N];int f[N][N];int main(){ ci
阅读全文
posted @ 2022-03-12 22:52 小白QIU
阅读(89)
评论(1)
推荐(0)
2022年1月3日
试除法求约数
摘要: #include <iostream>#include <vector>#include <algorithm>using namespace std;vector<int> get_divisors(int n){ vector<int> res; for(int i=1;i<=n/i;i++)
阅读全文
posted @ 2022-01-03 14:38 小白QIU
阅读(39)
评论(0)
推荐(0)
线性筛法
摘要: #include <iostream>using namespace std;const int N=100010;int primes[N],cnt;bool st[N];int n;void get_primes(int n){ for(int i=2;i<=n;i++) { if(!st[i]
阅读全文
posted @ 2022-01-03 11:49 小白QIU
阅读(30)
评论(1)
推荐(0)
筛质数
摘要: #include <iostream>using namespace std;const int N=100010;int primes[N],cnt;bool st[N];int n;//埃氏算法O(nloglogn) void get_primes(int n){ for(int i=2;i<=
阅读全文
posted @ 2022-01-03 11:33 小白QIU
阅读(36)
评论(0)
推荐(0)
2022年1月2日
分解质因数
摘要: #include <iostream>//n中最多只包含一个大于sqrt(n)的质因子using namespace std;void divide(int n){ for(int i=2;i<=n/i;i++) if(n%i==0) { int s=0; while(n%i==0) { n/=i;
阅读全文
posted @ 2022-01-02 19:07 小白QIU
阅读(37)
评论(0)
推荐(0)
试除法判定质数(素数)
摘要: #include <iostream>#include <algorithm>using namespace std;bool is_prim(int n){ if(n<2) return false; for(int i=2;i<=n/i;i++)//i<=sqrt(n)每次求的时候会调用一下sq
阅读全文
posted @ 2022-01-02 13:50 小白QIU
阅读(78)
评论(0)
推荐(0)
二分图的最大匹配
摘要: #include <iostream>#include <cstring>#include <algorithm>using namespace std;const int N=510,M=100010;int n1,n2,m;int h[N],e[M],ne[M],idx;int match[N]
阅读全文
posted @ 2022-01-02 11:32 小白QIU
阅读(31)
评论(0)
推荐(0)
2022年1月1日
染色法判定二分图
摘要: #include <iostream>#include <cstring>#include <algorithm>using namespace std;const int N=100010,M=200020;int n,m;int h[N],e[M],ne[M],idx;int color[N];
阅读全文
posted @ 2022-01-01 19:05 小白QIU
阅读(31)
评论(0)
推荐(0)
Kruskal算法求最小生成树
摘要: #include <iostream>#include <algorithm>using namespace std;const int N=200010;int n,m;int p[N];struct Edge{ int a,b,w; bool operator<(const Edge&W) co
阅读全文
posted @ 2022-01-01 12:05 小白QIU
阅读(32)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
下一页
公告