随笔分类 -  算法积累

摘要:题目: https://www.nowcoder.com/practice/9369f06924fa44a4ba2c462504c53297?tpId=122&rp=1&ru=%2Fta%2Fexam-wangyi&qru=%2Fta%2Fexam-wangyi%2Fquestion-ranking 阅读全文
posted @ 2020-08-02 16:33 龙龙666666 阅读(277) 评论(2) 推荐(0)
摘要:灵感来源:https://www.nowcoder.com/practice/7492dceb022a4bbebb990695c107823e?tpId=122&&tqId=33723&rp=1&ru=/ta/exam-wangyi&qru=/ta/exam-wangyi/question-rank 阅读全文
posted @ 2020-08-02 11:58 龙龙666666 阅读(307) 评论(1) 推荐(0)
摘要:传送门:http://acm.hdu.edu.cn/showproblem.php?pid=4864 The company hopes to maximize the number of the tasks which they can complete today. If there are m 阅读全文
posted @ 2019-08-19 15:25 龙龙666666 阅读(265) 评论(0) 推荐(0)
摘要:English appre: an infinite straight line:一条无限长的直线 on the coasting:在海岸线上 Cartesian coordinate system, 题目地址:http://poj.org/problem?id=1328 我的代码: 阅读全文
posted @ 2019-08-18 15:54 龙龙666666 阅读(155) 评论(0) 推荐(0)
摘要:__________________________________ Ad Hoc类问题的方法:(1)机理分析法。分析题目描述,推出算法。 (2)统计分析法。追寻最终的数学模型。 Problem 1: 起始的奇迹之年是1960年。 第n年的位数k=2^(2+(y-1960)/10),能放在k位中最大 阅读全文
posted @ 2019-08-04 16:02 龙龙666666 阅读(310) 评论(0) 推荐(0)
摘要:Problem description: To brighten up the gala dinner of the IOI'98 we have a set of N coloured lamps numbered from 1 to N. The lamps are connected to f 阅读全文
posted @ 2019-07-26 15:09 龙龙666666 阅读(227) 评论(0) 推荐(0)
摘要:——————————————————————————山前停马蹄,绿风揉春水,林间耸翠如眼,崖前无尽深渊。行到星子入夜,风声轻拂,恣意大观。 一个问题,只要能转化成对一些连续点的修改和统计问题,基本就可以用线段树来解决了。 线段树的原理,就是,将[1,n]分解成若干特定的子区间(数量不超过4*n),然 阅读全文
posted @ 2019-07-25 10:19 龙龙666666 阅读(170) 评论(0) 推荐(0)
摘要:谢谢你们一直爱着我! 加油! 代码实现线段树:(0).定义: (1).建树: (2).点修改: 假设A[L]+=C: 点修改其实可以写的更简单,只需要把一路经过的Sum都+=C就行了,不过上面的代码更加规范,在题目更加复杂的时候,按照格式写更不容易错。 (3)区间查询: 讨论区间查询的一种求和的情况 阅读全文
posted @ 2019-07-25 09:51 龙龙666666 阅读(263) 评论(0) 推荐(0)
摘要:走吧,目标伟大航路! 线段树的点点滴滴: 线段树之所以称为“树”,是因为其具有树的结构特性。线段树由于本身是专门用来处理区间问题的(包括RMQRMQ、RSQRSQ问题等。) 先从一些直观性的角度来看: 上图是用二分法丫!问题来喽, 对于给定区间[2,12]要如何分解成上述区间呢,何以分解之? 分解方 阅读全文
posted @ 2019-07-24 23:14 龙龙666666 阅读(231) 评论(0) 推荐(0)
摘要:PLA算法: https://blog.csdn.net/red_stone1/article/details/70866527 The problem: Analysis: 题目链接可见:https://vjudge.net/contest/313395#problem/M Reference c 阅读全文
posted @ 2019-07-22 13:59 龙龙666666 阅读(238) 评论(0) 推荐(0)