随笔分类 -  线段树or树状数组or主席树

摘要:线段树之所以称为“树”,是因为其具有树的结构特性。线段树由于本身是专门用来处理区间问题的(包括 RMQ 、 RSQ 问题等)。 入门必看: 线段树从零开始 线段树 从入门到进阶 Senior Data Structure · 浅谈线段树(Segment Tree) 进阶必看: 线段树详解 (原理,实 阅读全文
posted @ 2020-03-19 03:12 jiamian22 阅读(171) 评论(0) 推荐(0) 编辑
摘要:先粘上我入门时看的博客(下面部分摘自该博客): https://www.cnblogs.com/xenny/p/9739600.html 下面是我粘上以供自己复习的点: 树状数组的优点和缺点 修改和查询的复杂度都是O(logN),而且相比线段树系数要少很多,比传统数组要快,而且容易写。 缺点是遇到复 阅读全文
posted @ 2019-09-16 00:02 jiamian22 阅读(292) 评论(0) 推荐(0) 编辑
摘要:https://nanti.jisuanke.com/t/41422 题目大意: 给出n和b,求1到n,各数在b进制下各位数之和的总和。 直接暴力模拟,TLE。。 没想到是要打表。。。还是太菜了。 阅读全文
posted @ 2019-09-15 23:48 jiamian22 阅读(331) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1828 Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description A 阅读全文
posted @ 2019-09-05 01:24 jiamian22 阅读(230) 评论(0) 推荐(1) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4553 Problem Description 寒假来了,又到了小明和女神们约会的季节。 小明虽为屌丝级码农,但非常活跃,女神们常常在小明网上的大段发言后热情回复“呵呵”,所以,小明的最爱就是和女神们约会。与此同时 阅读全文
posted @ 2019-09-03 00:04 jiamian22 阅读(292) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4578 Time Limit: 15000/8000 MS (Java/Others) Memory Limit: 65535/65536 K (Java/Others) Problem Description Y 阅读全文
posted @ 2019-08-28 13:19 jiamian22 阅读(262) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4614 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Problem Description Al 阅读全文
posted @ 2019-08-28 01:42 jiamian22 阅读(304) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3974 Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description T 阅读全文
posted @ 2019-08-27 02:18 jiamian22 阅读(294) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1540 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description Du 阅读全文
posted @ 2019-08-26 19:45 jiamian22 阅读(235) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4027 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Problem Description A 阅读全文
posted @ 2019-08-25 19:17 jiamian22 阅读(303) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=3264 Time Limit: 5000MS Memory Limit: 65536K Description For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always 阅读全文
posted @ 2019-08-25 03:48 jiamian22 阅读(213) 评论(0) 推荐(0) 编辑
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1610 https://vjudge.net/contest/318019#problem/F Painting some colored segments on a line 阅读全文
posted @ 2019-08-25 03:01 jiamian22 阅读(218) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=2528 https://www.luogu.org/problem/UVA10587 Description The citizens of Bytetown, AB, could not stand that the candidates in 阅读全文
posted @ 2019-08-22 23:30 jiamian22 阅读(235) 评论(0) 推荐(0) 编辑
摘要:POJ-3468 - A Simple Problem with Integers(线段树区间更新模板) http://poj.org/problem?id=3468 Description You have N integers, A1, A2, ... , AN. You need to dea 阅读全文
posted @ 2019-08-22 01:26 jiamian22 阅读(281) 评论(0) 推荐(0) 编辑
摘要:HDU-1754 I Hate It http://acm.hdu.edu.cn/showproblem.php?pid=1754 Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需 阅读全文
posted @ 2019-08-18 02:17 jiamian22 阅读(205) 评论(0) 推荐(0) 编辑
摘要:http://codeforces.com/problemset/problem/558/E Examples input 1 output 1 input 2 output 2 题意:给出一个字母的序列(只包含小写字母),每次对它的一个区间进行排序(递增或递减),问最后的字母序列。 自闭题,身为蒟 阅读全文
posted @ 2019-08-17 18:04 jiamian22 阅读(159) 评论(0) 推荐(0) 编辑
摘要:原题地址:http://codeforces.com/problemset/problem/527/C Examples input output input output 题意是给定一个矩形,不停地纵向或横向切割,问每次切割后,最大的矩形面积是多少。 最大矩形面积=最长的长*最宽的宽这题,长宽都是 阅读全文
posted @ 2019-08-02 16:28 jiamian22 阅读(255) 评论(0) 推荐(0) 编辑
摘要:http://codeforces.com/problemset/problem/91/B B. Queue time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input outpu 阅读全文
posted @ 2019-08-01 13:50 jiamian22 阅读(744) 评论(0) 推荐(0) 编辑
摘要:题目地址:POJ 2828 Buy Tickets Description Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a lon 阅读全文
posted @ 2019-08-01 10:45 jiamian22 阅读(201) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示