上一页 1 2 3 4 5 6 7 8 9 10 ··· 19 下一页
摘要: 2/26更新: 一开始的做法忽略了一点: 题目中强调的是“请你求出最大的乘积,由于乘积可能超出整型范围,你只需输出乘积除以 $1000000009$(即 $10^9+9$)的余数”,而不是“取余后最大的乘积”。 整体思路: 先把arr数组按照绝对值降序排序,我们默认把前k个数字的乘积作为ans,如果 阅读全文
posted @ 2024-02-25 21:59 Gold_stein 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 以第四象限的形如(x,-x)的点(它的距离最好算)为基准,来推附近的点的距离。 不用怕坐标轴上的点的从属划分问题,例如在A区域和B区域交线上的点,那么它就应该是既满足A区域算法,又满足B区域算法的。 #include <bits/stdc++.h> using namespace std; long 阅读全文
posted @ 2024-02-24 22:39 Gold_stein 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 我的配置是12700H + 3070ti(laptop) + 32G RAM 刚好踩到了官方建议要求的边边,遂发布后不久便安装体验 截止2024年2月21日凌晨,依然没能成功地跑起来 第一个坑:python环境 在setup的过程中,chat with RTX会附带一个Miniconda和完整的py 阅读全文
posted @ 2024-02-21 01:01 Gold_stein 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 二分计数 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #define For(i, j, n) for(int i = j ; i <= n ; ++i) using namespace 阅读全文
posted @ 2024-02-13 23:24 Gold_stein 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 这份代码开了O2会WA和RE,但不开的话又会因为STL速度太慢而TLE #include <iostream> #include <stdio.h> #include <algorithm> #include <cmath> #include <string> #include <vector> # 阅读全文
posted @ 2024-02-10 13:37 Gold_stein 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 这种题目要注意: 1.输入 因为所有的格式都很明确,所以可以用scanf写一个输入格式,同时注意空格和回车 2.怎么简化计算 可以把所有时间都转换成秒进行计算,最后再转换回标准格式,这样可以避免考虑进位,借位,以及浮点数精度问题 #include <bits/stdc++.h> using name 阅读全文
posted @ 2024-01-26 16:10 Gold_stein 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 贪心,把钱最多的放在后面兜底,前面的能付多少付多少 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <math.h> #define For(i, j, n) for (in 阅读全文
posted @ 2024-01-24 16:51 Gold_stein 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 又是一道和取模有关的最值问题,因为原问题的规模太大,因此我们可以存储数字取模后的值 最极端的情况就就是三个模k同余的数字相加得到答案,因此每个剩余类只要存三个数字即可 #include <iostream> #include <stdio.h> #include <algorithm> #inclu 阅读全文
posted @ 2024-01-22 14:12 Gold_stein 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 这道题可以用类似单调队列的思路实现,因为其本质上是一个滑动窗口,虽然有两重循环,但是因为i和j是总的N被分摊之后的数字,所以真实的时间复杂度依然是O(N) #include <iostream> #include <stdio.h> #include <algorithm> #include <st 阅读全文
posted @ 2024-01-21 00:15 Gold_stein 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 这道题虽然逻辑很简单,但是坑不少,一不留神就WA了 要记得去重+排序 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <set> #define For(i, j, n) f 阅读全文
posted @ 2024-01-20 18:58 Gold_stein 阅读(26) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 19 下一页