摘要: 在写题时看到大佬们对树状数组的精妙使用,故进一步思考树状数组中的规律和信息: 存袁术数据a[], 存树状数组数据 f[] 1、观察到f [i] 一定保存了a [i] 的数据 2、观察到f [i] 前面还有i个数据 3、观察到lowbit(i)可以表示f [i]中保存数据的个数 4、观察到每次减去lo 阅读全文
posted @ 2022-10-06 21:39 ginkgozyf 阅读(36) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int n, primes[N]; int get_prime(int u) { int cnt = 0; memset(primes, true, sizeof 阅读全文
posted @ 2022-09-02 17:08 ginkgozyf 阅读(27) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 550, M = 1e5 + 10; int n1, n2, m, h[N], e[M], ne[M], idx; int match[N], ans; bool vis[N]; v 阅读全文
posted @ 2022-09-02 15:49 ginkgozyf 阅读(21) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10, M = 1e5 + 10, INF = 0x3f3f3f3f; int n, m, h[N], e[M << 1], ne[M << 1], idx, color 阅读全文
posted @ 2022-09-01 15:26 ginkgozyf 阅读(16) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10, M = 2e5 + 10, INF = 0x3f3f3f3f; int n, m, f[N]; struct edge{ int f, t, l; edge(){ 阅读全文
posted @ 2022-09-01 14:52 ginkgozyf 阅读(37) 评论(0) 推荐(0)
摘要: 朴素prim #include<bits/stdc++.h> using namespace std; const int N = 550, INF = 0x3f3f3f3f; int n, m, dis[N], g[N][N]; bool vis[N]; int prim() { memset(d 阅读全文
posted @ 2022-09-01 14:51 ginkgozyf 阅读(103) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 202, INF = 0x3f3f3f3f; int n, m, q; int g[N][N]; void floyd() { for(int k = 1; k <= n; k ++ 阅读全文
posted @ 2022-09-01 09:07 ginkgozyf 阅读(162) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 2020, M = 1e4 + 10, INF = 0x3f3f3f3f; int n, m, h[N], idx, dis[N], cnt[N]; bool vis[N]; str 阅读全文
posted @ 2022-08-31 21:02 ginkgozyf 阅读(19) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10, INF = 0x3f3f3f3f; int n, m, dis[N], h[N], idx; bool vis[N]; struct edge { int n, 阅读全文
posted @ 2022-08-31 20:04 ginkgozyf 阅读(17) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 505, M = 100010, INF = 0x3f3f3f3f; int n, m, dis[N], backup[N], k; struct edge { int f, t, 阅读全文
posted @ 2022-08-31 17:21 ginkgozyf 阅读(20) 评论(0) 推荐(0)