加载中...

上一页 1 2 3 4 5 6 7 ··· 17 下一页
摘要: 给出一个数组 a56爆大奖在线娱乐数组的值代表一个集合 相邻的两个集合不能重合 问集合中的最大数是多少 线段树维护这个区间的相邻数的最大值 因为相邻的条件a56爆大奖在线娱乐边界需要特判 #include<bits/stdc++.h> using namespace std; #define int long long #defi 阅读全文
posted @ 2022-09-07 23:30 liang302 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 给一棵树 看能不能往上跳k步 #include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <queue> #include <map> #include <vector> #includ 阅读全文
posted @ 2022-09-07 17:14 liang302 阅读(16) 评论(0) 推荐(0) 编辑
摘要: ##给定一张n个点 m条边的无向图,点有点权。需要进行n次操作,每次操作,选择一个点a,并移除该点以及与该点相连的所有边,其代价是与点a直接相连的所有点权和。问所有操作的代价的最大值的最小值是多少。 暴力 + 根堆 #include <bits/stdc++.h> using namespace s 阅读全文
posted @ 2022-09-06 22:25 liang302 阅读(29) 评论(0) 推荐(0) 编辑
摘要: ##连续的子序列的m个数 使得第i个数*a[i] 最终得到的值最大 https://atcoder.jp/contests/abc267/tasks/abc267_c 前缀和 + 滑动窗口 转移之间相差一个前缀和 和 a[m]*m vector<LL> a(n + 1, 0); LL ans = - 阅读全文
posted @ 2022-09-06 21:55 liang302 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 开放寻址法 int find(int x){ int t =(x % N + N) % N;/正数负数都存到里面 找个位置给他 while(h[t] != null && h[t] != x){//如果这个位置有值 但是不是那个位置 就找下个位置 t++; if(t==N) t=0;//到了尽头回去 阅读全文
posted @ 2022-09-06 20:41 liang302 阅读(37) 评论(0) 推荐(0) 编辑
摘要: ##https://www.acwing.com/problem/content/4613/ 可以进行操作 选择一行中的两个整数并交换它们。此操作,每行最多只能执行一次。 选择列表中的两列并交换它们。此操作,最多只能执行一次。 能否使得最终列表中每一行的 m 个整数都能按照 1,2,…,m 的顺序排 阅读全文
posted @ 2022-09-06 19:37 liang302 阅读(32) 评论(0) 推荐(0) 编辑
摘要: #include<queue> #include<cstdio> #include<cstring> #define N 500005 using namespace std; struct edge{ int to,val,next; } e[N]; int m,n,p,s,cnt,g[N],u[ 阅读全文
posted @ 2022-09-01 23:41 liang302 阅读(17) 评论(0) 推荐(0) 编辑
摘要: #https://www.luogu.com.cn/problem/P1262 间谍网络 关键在缩点的时候选择性的tarjan 只会搜搜得到的点 #include <iostream> #include <cstring> #include <algorithm> #include <unorder 阅读全文
posted @ 2022-09-01 20:26 liang302 阅读(14) 评论(0) 推荐(0) 编辑
摘要: #https://www.luogu.com.cn/problem/P2194 对a56爆大奖在线娱乐连通块的值求里面的点的最小值 然后加起来就是遍历所有点的最小值 方案数就根据乘法原理乘起来就可以 #include <iostream> #include <cstring> #include <algorithm 阅读全文
posted @ 2022-09-01 16:59 liang302 阅读(29) 评论(0) 推荐(0) 编辑
摘要: ##https://www.luogu.com.cn/problem/P1407 给n个男 女关系 在给m个男 女关系 a56爆大奖在线娱乐可能出轨的关系 如果原来的男女的关系断裂后(出轨) 是否能重新变成一个联通关系 这里使用强连通分量进行建图 对男设定为i 对应的女设为i+n a56爆大奖在线娱乐结果是i -> i+n #in 阅读全文
posted @ 2022-09-01 16:06 liang302 阅读(20) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 17 下一页