http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=709The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid
題目大意:有一個h*w的公告榜,可以依次在上面添加資訊。每個資訊的長度為x,高為1. 優先在最上面加入,如果空間足夠的話,然後優先放在最左面。統計每條公告最終的位置,即它所在的行數。這裡是線段樹來儲存 當前區間(i,j)的所有位置,剩餘的最大空間。 初始化即為w,公告榜的寬。Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is
成段更新,需要用到延遲標記(或者說懶惰標記),簡單來說就是每次更新的時候不要更新到底,用延遲標記使得更新延遲到下次需要更新or詢問到的時候.此處建議在紙上類比一遍。Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive
可參考這個題http://blog.csdn.net/gaotong2055/article/details/9300141DescriptionYou 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 in a given interval. The
FatMouse's SpeedTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6929 Accepted Submission(s): 3028Special JudgeProblem DescriptionFatMouse believes that the fatter a mouse is, the faster it
Problem DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could
以二階矩陣為例。典型的斐波那契數列,就可以使用矩陣相乘來求解。如果不考慮乘法的話,複雜度應該是lgn.下面只給出計算矩陣快速冪的方法#include <iostream>#define L 10000using namespace std;class MyMatrix{public:long long a00,a01,a10,a11;MyMatrix();MyMatrix(long long _a00, long long _a01, long long _a10, long
DescriptionBefore bridges were common, ferries were used to transport cars across rivers. River ferries, unlike their larger cousins, run on a guide line and are powered by the river's current. Cars drive onto the ferry from one end, the ferry
Problem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given an positive integer N, we define an equation like
DescriptionFarmer John has a pig farm near town A. He wants to visit his friend living in town B. During this journey he will visit n small villages so he decided to earn some money. He tooks n pigs and plans to sell one pig in each village he
Problem DescriptionWe all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou of China! “Oh, God! How terrible! ”Don’t be so afraid, guys. Although he hides in