Two years ago, when Amazon did not reach the same day, Apoorva Mehta, a former Amazon supply chain engineer, had an ambition to create an "one-hour delivery of Amazon". today, Instacart , who was founded by him, is said to have been talking about C-round financing for about $100 million, and the round will also make Instacart more than $2 billion in valuations. If we Previously introduced , users can buy
Atlanta tistime limit: 1000 msmemory limit: 32768 kbthis problem will be judged on HDU. Original ID: 1542
64-bit integer Io format: % i64d Java class name: Main there are several except ent Greek texts that contain descriptions of the fabled island Atlanta. some of these texts even include maps of parts of the island. but unfortunately, these maps describe different regions of
Atlanta
Time limit:1000 ms
Memory limit:10000 K
Total submissions:16882
Accepted:6435
DescriptionThere are several except ent Greek texts that contain descriptions of the fabled island Atlanta. some of these texts even include maps of parts of the island. but unfortunately, these maps describe different regions of Atlanta. y
Question:
Calculates the total area of the sum of N rectangles. Http://poj.org/problem? Id = 1151
Referring to the discretization pages in the black book, I thought of the polygon Filling Algorithm in computer graphics I learned last semester.
SRC:
/*************************************** * **************************** Created: created: 28: 3: 2013 11: 43 filename: H: \ Pe \ USA \ poj.1151.atlanta. cppfile path: H: \ Pe \ usafile base: poj.1151.
Atlanta
Time limit:1000 ms
Memory limit:10000kb
64bit Io format:% I64d % i64usubmit status
DescriptionThere are several except ent Greek texts that contain descriptions of the fabled island Atlanta. some of these texts even include maps of parts of the island. but unfortunately, these maps describe different regions of Atlanta. your friend Bill has to know the
Atlanta
Time limit:1000 ms
Memory limit:10000 K
Total submissions:17464
Accepted:6654
DescriptionThere are several except ent Greek texts that contain descriptions of the fabled island Atlanta. some of these texts even include maps of parts of the island. but unfortunately, these maps describe different regions of Atlanta. y
= | It seems that it is long enough in the draft box ~~~~~ I wanted to write a detailed scanned line ~~~ However, I don't want to change the code. I can compare it with the code of other Daniel. I think this single-point update is simply a pure violent pseudo line segment tree ~~~ There is also the discretization. [if it is discrete, we still use the function to go to O (n) to find out what is going on. Hello !] If the scope of the question is 10000, it is estimated that I will go to where the b
Atlanta is widely known and few people are seen on the street, only a few cars are running slowly on the road. The drivers here are very polite. Even if you violate the traffic lights and cross the road, they will stop very far and let you do it. This surprised me very much.
fresh fruit, freshly squeezed pure orange juice, sweet pastries, meat-based lunch, always ice-based drinks and water. I slowly did not adapt to it. About 1 about people atte
Scanning line problems
The first scanning line was followed by other people's code.
The tree does not have much content, so it is not put into the structure.
Map ing is very convenient and inefficient.
// 0 Ms 368 K g ++ # include # include #
Not to mention it first, because it is not quite understandable ~~~~~~
# Include # include # define N 105 using namespace STD; struct ELEM { double X; double S; double T; bool flag; }; struct node { int L; int R; int cover; double m;
Poj_1151
This topic is my first contact with discretization. After reading the related parts of the black book, I designedAlgorithm:
First, the x-y plane is regarded as the straight line where the four sides of the rectangle are located and cut
Inspired by this link, we can understand the scanning line:
Http://www.cnblogs.com/scau20110726/archive/2013/04/12/3016765.html
My code is as follows:
#include#include#include#include#include#include#include#include#include#includeusing namespace
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1542
This question is given n rectangles, and the area after the superposition is obtained. It is similar to the area intersection, that is, there is no requirement for the number of covers.
The Code
/* The scanning line problem of the Line Segment tree can be used as a template for such problems. I did this after I asked my senior brother...Create a line segment tree by Y axis. */Struct node {Int L, R, C; // C indicates that the data is
Question: Calculate the coverage area for N matrices. Thought: I read others' answer reports Given the coordinates in the lower left corner of a rectangle and the coordinates in the upper right corner are respectively: (x1, Y1) and (X2, Y2). For
Discretization: store all X axis coordinates in an array... sort. When entering a line segment, determine the discrete values corresponding to the left and right points by means of binary...
Scanning line .. it can be seen as a straight line
# Include # include # include # define MAXN 2222 using namespace std; struct line {double s, e, h, type; // records the starting and ending points of each line from the area of X weeks} L [MAXN]; // whether the bottom or the bottom is 1 High yes-1
Question address: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1542
This is my first scanned line question.
Method: Line Segment tree + scanning line.
Scan the X axis to the right of the X axis.
Sort the values of X first,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.