上一页 1 2 3 4 5 6 ··· 53 下一页
摘要: 数据结构 线段树 103107A(segmentbeats) 102798G(segmentbeats) 启发式合并 dsu on tree 2019icpc南昌K(dsu on tree+动态开点线段树) 2020ccpc长春F(dsu on tree) 轻重链剖分 HDU6962(轻重链剖分+线 阅读全文
posted @ 2021-07-28 09:20 19992147 阅读(67) 评论(0) 推荐(0) 编辑
摘要: A[CF1028A(800)] 发现矩阵中心可以用一些较为简单的方式表示,这里求出左上角和右下角即可算出中心。 #include <bits/stdc++.h> using namespace std; const int INF = numeric_limits<int> :: max() / 2 阅读全文
posted @ 2021-07-27 21:01 19992147 阅读(73) 评论(0) 推荐(0) 编辑
摘要: A:ARC112A 可以发现答案是一个等差数列,注意2L>R的时答案是0。 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T; 阅读全文
posted @ 2021-03-15 22:52 19992147 阅读(73) 评论(0) 推荐(0) 编辑
摘要: A(bzoj1650) #include<bits/stdc++.h> using namespace std; int a[200200]; int l,n,m; int check(int x) { int now = 0; int mi = 0; for(int i = 1;i <= n;i+ 阅读全文
posted @ 2021-02-15 22:08 19992147 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 最短路(堆优化) #include <bits/stdc++.h> using namespace std; const int inf = 1000000000; void dij() { int n, m, s; cin >> n >> m >> s; vector<vector<pair<in 阅读全文
posted @ 2021-01-31 23:51 19992147 阅读(64) 评论(0) 推荐(0) 编辑
摘要: A https://atcoder.jp/contests/abc177/tasks/abc177_c?lang=en #include <bits/stdc++.h> using namespace std; const int P = 1000000007; int main() { ios:: 阅读全文
posted @ 2021-01-24 21:53 19992147 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 贪心想了两个小时 想到怀疑人生 其实是一个简单的$dp$ $dp[i][0]$表示不选父边 $dp[i][1]$表示选 那么儿子排个序贪心一下就行了 感觉头铁总是会凉 一个想法不行要尝试换一下 #include <bits/stdc++.h> using namespace std; using l 阅读全文
posted @ 2020-02-04 10:36 19992147 阅读(179) 评论(0) 推荐(0) 编辑
摘要: A 枚举一下 #include <bits/stdc++.h> using namespace std; int main() { int x, y; cin >> x >> y; int ans = 0; if(x == 1) { ans += 300000; } if(x == 2) { ans 阅读全文
posted @ 2020-02-04 10:24 19992147 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 交互 问题就是如何确定点的顺序 只有一个点肯定不行 需要除$1$号点找一个基准点 也就是和$1$号点相邻的点 这个可以通过$n$次叉积问出来 然后就是确定顺序 通过叉积确定比较困难 因为一次只能问出来两个点的相对顺序 这样需要$n^2$次 考虑面积询问 可以通过面积询问确定 其他点到两点连线距离 凸 阅读全文
posted @ 2020-01-27 23:57 19992147 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 扫描线 先跑一个扫描线 统计不删除的答案 然后考虑对于每个线段计算删除的答案 思考一下什么情况下删除线段答案增加 当扫描线扫到了一个右端点 并且set里只有一条线段 这时set里的线段贡献+1 这里比较好思考 还要注意如果当前线段只有一条 那么答案-1 一条线段右端点也可能造成贡献 但是不用特别计算 阅读全文
posted @ 2020-01-27 23:45 19992147 阅读(121) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 53 下一页