会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
superPG
博客园
首页
新随笔
联系
订阅
管理
1
2
3
4
5
下一页
2022年8月25日
CSP 202006-1 202006-2 题解
摘要: # 202006-1 线性分类器 在坐标系中,我们可以考虑使用同一横坐标x值对应的y值来判断在直线的上方一侧还是在下方一侧。 当然,如果不在坐标系中也可以统计点和直线的位置关系,这个属于计算几何的内容,感兴趣的同学可以点击这个网址自己查阅相关内容,这里就不赘述了。 还有一点需要注意的是,本题计算过程
阅读全文
posted @ 2022-08-25 09:59 superPG
阅读(71)
评论(0)
推荐(0)
2022年8月6日
2023.6.8 AcWing LeetCode
摘要: AcWing 二分 + DFS树遍历 注意,虽然树中边的数量为顶点数-1,但是由于实际中将无向边存为两条有向边,所以数组开辟的边数个数要是顶点数的两倍。 #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int
阅读全文
posted @ 2022-08-06 09:16 superPG
阅读(31)
评论(0)
推荐(0)
2022年8月3日
2022.8.3
摘要: LeetCode 思维题 最小表示法 最小表示法题解 最小表示法: 最小表示法原理及实现在这篇blog中 AcWing 16进制读写 #include<bits/stdc++.h> using namespace std; int ans; int main() { while(scanf("%X"
阅读全文
posted @ 2022-08-03 15:35 superPG
阅读(20)
评论(0)
推荐(0)
2022年8月2日
2022.8.2 L:eetCode
摘要: LeetCode 模拟循环队列 https://leetcode.cn/problems/design-circular-queue/solution/672-by-sen-xm-n0on/ AcWing 想用getline实现一下,但是截取单词子串的时候取成 i = j 和 j = i 了,这样的
阅读全文
posted @ 2022-08-02 09:26 superPG
阅读(33)
评论(0)
推荐(0)
2022年7月31日
2022.7.31 LeetCode AcWing周赛
摘要: LeetCode BFS 层序遍历模板题 https://leetcode.cn/problems/maximum-level-sum-of-a-binary-tree/solution/1161-by-sen-xm-3q4t/ AcWing 周赛第二题 单点修改 + 区间修改 + 区间查询 如果暴
阅读全文
posted @ 2022-07-31 14:59 superPG
阅读(45)
评论(0)
推荐(0)
2022年7月30日
2022.7.30 LeetCode AcWing
摘要: LeetCode 建图 + 并查集 + (筛法求质数) 如果暴力的建图,跑dfs最大连通图,建图会成为瓶颈,O(n^2)。 但是考虑到,A、B两数,A、B分别与其非1非自身的因数相连,如果A、B之间联通,那么A、B相互联通的那个点为公因数。可以将时间复杂度从依赖数据量的大小转移到依赖数据按数据范围。
阅读全文
posted @ 2022-07-30 09:38 superPG
阅读(68)
评论(0)
推荐(0)
2022年7月29日
2022.7.29 LeetCode AcWing
摘要: LeetCode 模拟 特判 https://leetcode.cn/problems/valid-square/solution/593-mo-ni-by-sen-xm-73z6/ AcWing 思维题 对于A来说,其他蚂蚁碰头与否没有任何关系,即不与A碰头的蚂蚁可以看做相互之间直接穿过而不产生影
阅读全文
posted @ 2022-07-29 10:04 superPG
阅读(24)
评论(0)
推荐(0)
2022年7月28日
2022.7.28 LeetCode AcWing
摘要: LeetCode STL 模拟 https://leetcode.cn/problems/rank-transform-of-an-array/solution/1331-stl-by-sen-xm-w57d/ AcWing 贪心 如果有解,从大到小依次判断是否能加入部分和中使得部分和不会超过目标和
阅读全文
posted @ 2022-07-28 10:06 superPG
阅读(31)
评论(0)
推荐(0)
2022年7月27日
2022.7.27 LeetCode AcWing
摘要: LeetCode 模拟 + 字符串 题解如下: https://leetcode.cn/problems/fraction-addition-and-subtraction/solution/by-sen-xm-u2ak/ string转int: https://blog.csdn.net/xion
阅读全文
posted @ 2022-07-27 10:00 superPG
阅读(34)
评论(0)
推荐(0)
2022年7月26日
2022.7.26 LeetCode AcWing
摘要: LeetCode 实现跳表 主要参考了以下几篇Bolg: https://www.acwing.com/blog/content/15081/ https://www.jianshu.com/p/9d8296562806 https://www.acwing.com/blog/content/486
阅读全文
posted @ 2022-07-26 10:19 superPG
阅读(29)
评论(0)
推荐(0)
1
2
3
4
5
下一页
公告