随笔分类 - 线段树or树状数组or主席树
摘要:线段树之所以称为“树”,是因为其具有树的结构特性。线段树由于本身是专门用来处理区间问题的(包括 RMQ 、 RSQ 问题等)。 入门必看: 线段树从零开始 线段树 从入门到进阶 Senior Data Structure · 浅谈线段树(Segment Tree) 进阶必看: 线段树详解 (原理,实
阅读全文
摘要:先粘上我入门时看的博客(下面部分摘自该博客): https://www.cnblogs.com/xenny/p/9739600.html 下面是我粘上以供自己复习的点: 树状数组的优点和缺点 修改和查询的复杂度都是O(logN),而且相比线段树系数要少很多,比传统数组要快,而且容易写。 缺点是遇到复
阅读全文
摘要:https://nanti.jisuanke.com/t/41422 题目大意: 给出n和b,求1到n,各数在b进制下各位数之和的总和。 直接暴力模拟,TLE。。 没想到是要打表。。。还是太菜了。
阅读全文
摘要: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
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4553 Problem Description 寒假来了,又到了小明和女神们约会的季节。 小明虽为屌丝级码农,但非常活跃,女神们常常在小明网上的大段发言后热情回复“呵呵”,所以,小明的最爱就是和女神们约会。与此同时
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1610 https://vjudge.net/contest/318019#problem/F Painting some colored segments on a line
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:HDU-1754 I Hate It http://acm.hdu.edu.cn/showproblem.php?pid=1754 Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需
阅读全文
摘要:http://codeforces.com/problemset/problem/558/E Examples input 1 output 1 input 2 output 2 题意:给出一个字母的序列(只包含小写字母),每次对它的一个区间进行排序(递增或递减),问最后的字母序列。 自闭题,身为蒟
阅读全文
摘要:原题地址:http://codeforces.com/problemset/problem/527/C Examples input output input output 题意是给定一个矩形,不停地纵向或横向切割,问每次切割后,最大的矩形面积是多少。 最大矩形面积=最长的长*最宽的宽这题,长宽都是
阅读全文
摘要: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
阅读全文
摘要:题目地址: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
阅读全文