摘要: ##### #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)
摘要: #### #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)
摘要: #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)
摘要: #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)
摘要: #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)
摘要: #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)