Stay Hungry,Stay Foolish!

10 2022 档案

摘要:D - Yet Another Recursive Function https://atcoder.jp/contests/abc275/tasks/abc275_d 思路 动态规划问题。 第一印象使用函数递归调用实现, 但刚开始担心会爆栈,因为n很大会产生很多次递归调用层数, 所以,最开始考虑使 阅读全文
posted @ 2022-10-31 22:46 lightsong 阅读(44) 评论(0) 推荐(0) 编辑
摘要:C - Counting Squares https://atcoder.jp/contests/abc275/tasks/abc275_c 参考: https://atcoder.jp/contests/abc275/submissions/36103954 思路 首先不能使用暴力穷举法,任意四个 阅读全文
posted @ 2022-10-31 12:20 lightsong 阅读(128) 评论(0) 推荐(0) 编辑
摘要:load balance https://zhuanlan.zhihu.com/p/64777456 四层负载均衡(tcp) 在三层负载均衡的基础上,用 ip+port 接收请求,再转发到对应的机器。 七层负载均衡(http) 根据虚拟的 url 或 IP,主机名接收请求,再转向相应的处理服务器。 阅读全文
posted @ 2022-10-30 22:30 lightsong 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Argparse https://www.geeksforgeeks.org/argparse-vs-docopt-vs-click-comparing-python-command-line-parsing-libraries/ python内置库。 使用代码形式定义CLI. Argparse i 阅读全文
posted @ 2022-10-29 18:50 lightsong 阅读(9) 评论(0) 推荐(0) 编辑
摘要:背景 pytest属于单元测试, 测试对象为模块函数, 对于argparse应用,需要带有参数进行测试的情况, 是否也可以将其对待为函数,带有测试的参数? 答案是可以的。 Example https://github.com/simonw/stream-delay/tree/0.1 例如, 此pac 阅读全文
posted @ 2022-10-28 23:59 lightsong 阅读(165) 评论(0) 推荐(0) 编辑
摘要:问题 数据类型一般都提供 kw初始化,和 position 初始化。 例如 class DATA(): m: int n: int kw 初始化: d = DATA(m=1, n=1) position初始化 d = DATA(1, 1) 因为对于相对大的数据集合,postion初始化容易对错位置。 阅读全文
posted @ 2022-10-27 11:14 lightsong 阅读(24) 评论(0) 推荐(0) 编辑
摘要:D - Div Game https://atcoder.jp/contests/abc169/tasks/abc169_d 参考: https://blog.csdn.net/justidle/article/details/106474626 思路 计算n中所有质数的幂, Note: 此处不需要 阅读全文
posted @ 2022-10-26 20:42 lightsong 阅读(33) 评论(0) 推荐(0) 编辑
摘要:D - LRUD Instructions https://atcoder.jp/contests/abc273/tasks/abc273_d 分析 横坐标和纵坐标很大,不能采用二维数组形式,否则内存干爆, 目标对象移动,按照指令进行移动, 每次沿垂直或者水平方向, 那么这里对每一个墙, 都记录两点 阅读全文
posted @ 2022-10-26 08:51 lightsong 阅读(73) 评论(0) 推荐(0) 编辑
摘要:D - Not Divisible https://atcoder.jp/contests/abc170/tasks/abc170_d 思路 输入过程记录每个数字出现的次数, 遍历所有数字ai, 对于每一个数字,在1 .. sqrt(ai) 之间找此数的因子, 如果因子f出现过,则此数不是 not 阅读全文
posted @ 2022-10-25 09:25 lightsong 阅读(24) 评论(0) 推荐(0) 编辑
摘要:D - Longest X https://atcoder.jp/contests/abc229/tasks/abc229_d 参考: https://zhuanlan.zhihu.com/p/441875505 思路 使用acc累计数组,统计每个位置之前的.的数目 设置滑动窗口最大化字串长度,使得 阅读全文
posted @ 2022-10-25 09:18 lightsong 阅读(34) 评论(0) 推荐(0) 编辑
摘要:C - Ameba https://atcoder.jp/contests/abc274/tasks/abc274_c 题目分析 Code https://atcoder.jp/contests/abc274/submissions/35890782 int n; int a; map<int, i 阅读全文
posted @ 2022-10-24 09:56 lightsong 阅读(41) 评论(0) 推荐(0) 编辑
摘要:D - Robot Arms 2 题目 : https://atcoder.jp/contests/abc274/tasks/abc274_d 参考: https://zhuanlan.zhihu.com/p/576281206 分析 dfs或者bfs最大复杂度 2^1000, 超时必然的。 采用内 阅读全文
posted @ 2022-10-24 09:48 lightsong 阅读(57) 评论(0) 推荐(0) 编辑
摘要:lower_bound https://www.geeksforgeeks.org/lower_bound-in-cpp/ 在有序数组中,找到大于或等于目标值的数据集合中值最小的位置。 The lower_bound() method in C++ is used to return an iter 阅读全文
posted @ 2022-10-24 09:36 lightsong 阅读(62) 评论(0) 推荐(0) 编辑

千山鸟飞绝,万径人踪灭
点击右上角即可分享
微信分享提示