Stay Hungry,Stay Foolish!

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 32 下一页
摘要: 1055. Combinations https://acm.timus.ru/problem.aspx?space=1&num=1055 思路 对于组合数 C(M,N) 不能使用公式计算最终值,然后再根据最终值,分解质因数,统计质因数个数; 因为这种情况会导致数值越界。 改变思路, 组合数公式实际 阅读全文
posted @ 2023-01-03 15:34 lightsong 阅读(29) 评论(0) 推荐(0)
摘要: F - Permutation Distance https://atcoder.jp/contests/abc283/tasks/abc283_f 思路 最小生成树法: https://zhuanlan.zhihu.com/p/595421879 动态缩减查找距离法 朴素思维: 如果按照Di定义, 阅读全文
posted @ 2023-01-03 12:20 lightsong 阅读(55) 评论(0) 推荐(0)
摘要: D - Scope https://atcoder.jp/contests/abc283/tasks/abc283_d 思路 使用stack做字符串的内容分析, 除了)所有的字符依次入栈, 遇到(字符,则从栈顶开始依次出栈,直到第一个(也被出栈; 使用set做已入栈的小写字母统计, 在小写字母入栈过 阅读全文
posted @ 2023-01-01 22:53 lightsong 阅读(62) 评论(0) 推荐(0)
摘要: C. On Number of Decompositions into Multipliers https://codeforces.com/problemset/problem/397/C 思路 Code https://codeforces.com/contest/397/submission/ 阅读全文
posted @ 2023-01-01 22:46 lightsong 阅读(33) 评论(0) 推荐(0)
摘要: D - Make Bipartite 2 https://atcoder.jp/contests/abc282/tasks/abc282_d Simple Graph https://mathworld.wolfram.com/SimpleGraph.html A simple graph, als 阅读全文
posted @ 2022-12-18 00:50 lightsong 阅读(111) 评论(0) 推荐(0)
摘要: Median http://poj.org/problem?id=3579 思路 参考: https://www.cnblogs.com/sky-stars/p/11317030.html lower_bound http://c.biancheng.net/view/7521.html 阅读全文
posted @ 2022-12-12 21:14 lightsong 阅读(96) 评论(0) 推荐(0)
摘要: Floyd算法 dijistra算法解决,从一点出发,到其它所有点的最短路径。 此算法解决,从任何一点出发,到任何点的最短路径。 https://zhuanlan.zhihu.com/p/87480486 理解 阅读全文
posted @ 2022-12-11 23:40 lightsong 阅读(43) 评论(0) 推荐(0)
摘要: 1053. Pinocchio https://acm.timus.ru/problem.aspx?space=1&num=1053 思路 每次取两个,进行比较, 相等则舍去一个, 不相等,则从长的里面减去短的。 对于不相等的情况, 则相当于将长的中多减几次短的,直到不能减为止,这就相当于求最大公约 阅读全文
posted @ 2022-12-10 15:33 lightsong 阅读(38) 评论(0) 推荐(0)
摘要: 1236. Decoding Task https://acm.timus.ru/problem.aspx?space=1&num=1236 思路 对于带空格串加密结果,第一个字符61,K1K2 XOR 32 = 61,可以算出K1K2 对于原始串加密结果,第一个字符05, K1K2 XOR C1C 阅读全文
posted @ 2022-12-10 14:45 lightsong 阅读(37) 评论(0) 推荐(0)
摘要: D - Factorial and Multiple https://atcoder.jp/contests/abc280/tasks/abc280_d 思路 Code https://blog.csdn.net/wp_fxy/article/details/128179159 https://ww 阅读全文
posted @ 2022-12-07 10:21 lightsong 阅读(80) 评论(0) 推荐(0)
摘要: E - Critical Hit https://atcoder.jp/contests/abc280/tasks/abc280_e REFERENCE https://blog.csdn.net/sophilex/article/details/128169335 dp[i]=(dp[i-2]+1 阅读全文
posted @ 2022-12-05 23:26 lightsong 阅读(71) 评论(0) 推荐(0)
摘要: Q Learning 升级版 https://zhuanlan.zhihu.com/p/110657606 Q Learning面向的是离散状态空间, DQN可以面向连续状态空间。 Sample Code https://github.com/louisnino/RLcode/blob/master 阅读全文
posted @ 2022-12-01 15:28 lightsong 阅读(336) 评论(0) 推荐(0)
摘要: D - Freefall https://atcoder.jp/contests/abc279/tasks/abc279_d 思路 求凹函数的极小值 https://www.cnblogs.com/luoyj/p/12408277.html#6 #include<bits/stdc++.h> usi 阅读全文
posted @ 2022-11-27 22:34 lightsong 阅读(114) 评论(0) 推荐(0)
摘要: E - Crystal Switches https://atcoder.jp/contests/abc277/tasks/abc277_e 思路 做双层图分离。 使用虚线连接两个图,表示switch动作。 使用双端队列,结合最短路算法,从1出发,遍历所有节点。 取两个目标节点路径更小值。 Code 阅读全文
posted @ 2022-11-19 12:07 lightsong 阅读(50) 评论(0) 推荐(0)
摘要: Q-Learning https://www.geeksforgeeks.org/q-learning-in-python/ Reinforcement Learning briefly is a paradigm of Learning Process in which a learning ag 阅读全文
posted @ 2022-11-14 22:38 lightsong 阅读(291) 评论(0) 推荐(0)
摘要: D - Takahashi's Solitaire https://atcoder.jp/contests/abc277/tasks/abc277_d 思路 先计算所有的输入的和 total, 将输入列表首先进行排列 找到所有连续段和中最大的值 maxsum, 此处连续满足条件 a[i] == a[ 阅读全文
posted @ 2022-11-13 23:46 lightsong 阅读(104) 评论(0) 推荐(0)
摘要: C - Ladder Takahashi https://atcoder.jp/contests/abc277/tasks/abc277_c 思路 把梯子可达楼层看成图的节点 把梯子看成节点之间的连线 所以整个问题变成图的遍历问题,找到所有节点的最大值。 Code https://atcoder.j 阅读全文
posted @ 2022-11-13 23:39 lightsong 阅读(152) 评论(0) 推荐(0)
摘要: How JWT (JSON Web Token) authentication works? https://www.idiotinside.com/2019/09/26/how-jwt-authentication-works/ What is JWT (JSON Web Token)? JSON 阅读全文
posted @ 2022-11-10 23:18 lightsong 阅读(82) 评论(0) 推荐(0)
摘要: TOPIC https://fastapi.tiangolo.com/advanced/security/oauth2-scopes/ FASAPI不支持OAuth2的全部流程,但是支持scopes功能, 类似一起全集API,特定的用户只能访问其scope范围之内的API, 使用此功能, 即不再是登 阅读全文
posted @ 2022-11-10 16:21 lightsong 阅读(233) 评论(0) 推荐(0)
摘要: OAuth2 https://oauth.net/2/ OAuth 2.0 OAuth 2.0 is the industry-standard protocol for authorization. OAuth 2.0 focuses on client developer simplicity 阅读全文
posted @ 2022-11-10 16:09 lightsong 阅读(130) 评论(0) 推荐(0)
摘要: 泛型(Generics) https://www.geeksforgeeks.org/generics-in-java/ 一般类的定义,其引用类是要在其代码中明确指定的 但是对于一些上层公共逻辑,其期望可以应用到若干引用类中 则定义泛型类, 可以满足这种需求。 泛型类在使用的使用, 才绑定具体的引用 阅读全文
posted @ 2022-11-08 10:49 lightsong 阅读(385) 评论(0) 推荐(0)
摘要: FastAPI CRUD Router https://github.com/awtkns/fastapi-crudrouter fastapi提供基础的制作API能力 对于简单的业务来说,对于表仅仅需要 CRUD 接口,不需要其他额外的数据逻辑, 对于这种情况,我们希望能够快速提供对指定表格的 C 阅读全文
posted @ 2022-11-02 22:28 lightsong 阅读(438) 评论(0) 推荐(0)
摘要: dataset https://dataset.readthedocs.io/en/latest/index.html https://github.com/pudo/dataset https://dataset.readthedocs.io/en/latest/quickstart.html#s 阅读全文
posted @ 2022-11-01 18:25 lightsong 阅读(39) 评论(0) 推荐(0)
摘要: D - Yet Another Recursive Function https://atcoder.jp/contests/abc275/tasks/abc275_d 思路 动态规划问题。 第一印象使用函数递归调用实现, 但刚开始担心会爆栈,因为n很大会产生很多次递归调用层数, 所以,最开始考虑使 阅读全文
posted @ 2022-10-31 22:46 lightsong 阅读(58) 评论(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 阅读(158) 评论(0) 推荐(0)
摘要: load balance https://zhuanlan.zhihu.com/p/64777456 四层负载均衡(tcp) 在三层负载均衡的基础上,用 ip+port 接收请求,再转发到对应的机器。 七层负载均衡(http) 根据虚拟的 url 或 IP,主机名接收请求,再转向相应的处理服务器。 阅读全文
posted @ 2022-10-30 22:30 lightsong 阅读(169) 评论(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 阅读(27) 评论(0) 推荐(0)
摘要: 背景 pytest属于单元测试, 测试对象为模块函数, 对于argparse应用,需要带有参数进行测试的情况, 是否也可以将其对待为函数,带有测试的参数? 答案是可以的。 Example https://github.com/simonw/stream-delay/tree/0.1 例如, 此pac 阅读全文
posted @ 2022-10-28 23:59 lightsong 阅读(200) 评论(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 阅读(36) 评论(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 阅读(40) 评论(0) 推荐(0)
摘要: D - LRUD Instructions https://atcoder.jp/contests/abc273/tasks/abc273_d 分析 横坐标和纵坐标很大,不能采用二维数组形式,否则内存干爆, 目标对象移动,按照指令进行移动, 每次沿垂直或者水平方向, 那么这里对每一个墙, 都记录两点 阅读全文
posted @ 2022-10-26 08:51 lightsong 阅读(93) 评论(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 阅读(43) 评论(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 阅读(44) 评论(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 阅读(57) 评论(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 阅读(81) 评论(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 阅读(98) 评论(0) 推荐(0)
摘要: The Twelve-Factor App https://12factor.net/ Introduction In the modern era, software is commonly delivered as a service: called web apps, or software- 阅读全文
posted @ 2022-09-30 23:57 lightsong 阅读(85) 评论(0) 推荐(0)
摘要: pytest https://docs.pytest.org/en/7.1.x/contents.html # content of test_sample.py def func(x): return x + 1 def test_answer(): assert func(3) == 5 A h 阅读全文
posted @ 2022-09-30 22:45 lightsong 阅读(38) 评论(0) 推荐(0)
摘要: loguru https://loguru.readthedocs.io/en/stable/index.html 开箱即用,简化用户配置。 Loguru is a library which aims to bring enjoyable logging in Python. Did you ev 阅读全文
posted @ 2022-09-30 16:47 lightsong 阅读(134) 评论(0) 推荐(0)
摘要: DI https://www.professionalqa.com/dependency-injection What is Dependency Injection? A software design pattern that implements inversion of control fo 阅读全文
posted @ 2022-09-28 23:53 lightsong 阅读(199) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 32 下一页
千山鸟飞绝,万径人踪灭