01 2018 档案
摘要:推荐博客 : https://www.cnblogs.com/ice-wing/p/7709311.html 此类问题要解决的通常是 树上的某个点到另一个点的所有路径 差分 : 对于一个一维的数组,我们如果要改动态多次修改一个区间,比如给这个区间的所有值全部 加 1,那么我们是不在这个区间的头进行一
阅读全文
摘要:Amr loves Chemistry, and specially doing experiments. He is preparing for a new interesting experiment. Amr has n different types of chemicals. Each c
阅读全文
摘要:“今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...” 确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永
阅读全文
摘要:Iahub and Sorin are the best competitive programmers in their town. However, they can't both qualify to an important contest. The selection will be ma
阅读全文
摘要:推荐博客 : https://www.cnblogs.com/zyxStar/p/4591897.html 问题描述 : 已知在平面上有散落的好多点,求相距最近的两个点的距离是多少 ? 一 、 穷举法 最暴力的解法,枚举出所有可能的点对,这样复杂度就是 n^2 二 、分治法 (复杂度 n*logn)
阅读全文
摘要:Given a list of N integers with absolute values no larger than 10 15, find a non empty subset of these numbers which minimizes the absolute value of t
阅读全文
摘要:工大要建新教学楼了,一座很高很高的楼,它有n层。学校为了减少排电梯的队伍,建造了好多好多电梯,共有m个。为了让电梯有序,学校给每个电梯设定了独特的可停楼层,如 x1 x2 y1 y2 表示,x1楼层到x2楼层可停,y1楼层到y2楼层可停。然后其他楼层这个电梯都不停一天,yanga11ang想去顶层观
阅读全文
摘要:You are given an array consisting of n non-negative integers a1, a2, ..., an. You are going to destroy integers in the array one by one. Thus, you are
阅读全文
摘要:One beautiful July morning a terrible thing happened in Mainframe: a mean virus Megabyte somehow got access to the memory of his not less mean sister
阅读全文
摘要:You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number
阅读全文
摘要:推荐博客 :https://blog.csdn.net/wconvey/article/details/7827188 在第二遍看了树状数组后, 感觉有了更深的认识,既然是树状数组,从名字来看,就是像树的一个数组,没错,就是一个普通的数组,我们把他假定成为一棵树。 用 C1 表示 A1 的和 用 C
阅读全文
摘要:Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer. A
阅读全文
摘要:typedef struct node { int data; struct node *lchild, *rchild; }bitnode, *bitree; bool search(bitree T, int x, bitree f, bitree *p){ // 查找应该插入的位置 if (!T) { *p = f; return ...
阅读全文
摘要:A binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the left and right subtree
阅读全文
摘要:Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is
阅读全文
摘要:1. The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessi
阅读全文