This problem has taught me to re-learn the operation of multiply in the interval.Puzzle: Http://blog.csdn.net/guognib/article/details/25324025?utm_source=tuicoolutm_medium=referralCode: Also refer to the above writtenNote: There is really a priority, plus only affect themselves, multiply will affect the plus, reset value will clear 0 all the marksSo when you go down, multiply and add the operation is later than the last set value, and then multiply the operation to precede the additionSo first p
affects only that point and the weight of the leaf node of the point. The code is as follows:#include #include#include#include#includeusing namespaceStd;typedefLong LongLL;Const intMAXN =100000+ -;intN, M;vectorint>TREE[MAXN];intNODE_WEIGHT[MAXN]; LL NUM[MAXN];intL[MAXN], R[MAXN], NLR;structSegment {intL, R; LL x; LL lazy;} seg[3*MAXN];voidBuildintRtintLintr) {SEG[RT].L= L; SEG[RT].R =R; if(L = =r) {seg
http://poj.org/problem?id=3468 topic links, very classical application of line tree, here to review, and then write again, the code is as follows:#include #include#includeusing namespacestd;Const intMAXN =100000+Ten;intN, Q;intA[MAXN];structsegment{intL, R; Long Longsum; intlazy;} seg[3*MAXN];voidBuildintRtintLintR) {SEG[RT].L= L; SEG[RT].R =R; Seg[rt].lazy=0; if
Title Link: http://poj.org/problem?id=2761The main topic: give you n number, m times query, M query is a,b,k, query the following table from A to B of the K small element is which. The M-bands do not contain one another.Treap, I learned to write a board, stay paste spare.Offline operation, move the interval, delete the old add new.#include #include#include#include#include#includeSet>#includestring>#include#include#include#include#include#include#include#include#include#include#includeusing names
Test Instructions:LinkMethod:Treap+lisparsing:Just saw the question also blindfolded for a while, do not know AH--! later thinking to find the law. Drawing examples and the two sets of data have been made up to find point problems ... The answer increments? And then the reaction comes--when we get into the big insert, the post-insertion situation does not affect the pre-insertion. So we can get the whole sequence out first? After a LIS, for each number, he has an LIS value, of course, this may n
. Exit
Source program attached:
/*Funtion: Send emailAuthor: liyananData: 2006-08 8*/# Include # Include # Include # Include # Include # Include # Include # Include # Include # Include # Include # Include # Include # Include
# Define eth_name "eth0"# Define sd_both 2# Define socket_error-1# Define invalid_socket-1Int S;Struct sockaddr_in remote;Unsigned short port;Int RT;Char * send_data;Char * recv_data;Char * hostname;Struct hostent * HT;Char * use
Segment Tree interval Merge single point modification interval query. Another 1 seconds of conception, the error has been checked for a long time ... The definition of an int was found to be a char type, with a punch face.#include #includestring.h>#include#include#include#include#include#includeSet>#include#includestring>#include#include#includeusing namespacestd;Const intmaxn=50000+Ten;intn,q;Charop[5];intNum;stackint>S;BOOLFLAG[MAXN];structsegtree{intLsum,rsum,msum;} segtree[4*MAXN];intFail,an
each command and the numbers that follow.
ensure that the input data is correct, the number of deletions must exist.
"Output" (arr.out)
for each delete command, output the number of deletes in the order of the Delete command, each line
"Sample Input"
Ten
I
I
I
d 3
I
D 2
D 2
d 1
I
I
"Sampl
The idea is simple, but the realization of some places need to pay attention to,1) Insert (Node *rt,int num) of the parameter, the pointer is the address of the parameter is passed, you can modify the address of the parameter refers to the purpose of the content, but the parameter value is the address value will not change, the first insert is written like this void Insert (Node *rt,int num) { if (
There are many things worth learning about edge switches. Here we mainly introduce a comprehensive description of the intelligent and performance of edge switches. If the edge devices of the network integrate QoS, rate limit, ACL, PBR, and sFlow into the hardware chip, the Intelligence will not affect the line rate forwarding performance of the basic layer 2 and Layer 3, therefore, the end-to-end smart network can be carried out on a large scale, so t
Edge Switch Equipment plays a very important role in networking. How can we balance the intelligence and performance of edge Switch Equipment? If the edge switch device of the network integrates QoS, rate limit, ACL, PBR, and sFlow into the hardware chip, the Intelligence will not affect the line rate forwarding performance of the basic layer 2 and Layer 3,
Therefore, the end-to-end smart network can be carried out on a large scale, so that the entire
software, this kind of software is an effective tool to judge the flow of abnormal traffic, through the monitoring of traffic size change, can help network management personnel to find abnormal traffic, especially the flow of abnormal traffic flow, so as to further find the source address and destination address of abnormal traffic.(3) Protocol analysis technology.Protocol analysis technology is used to solve the understanding of what protocols and applications users use, including protocol and
Inputon ()
Dim t ' variable
While True ' loop until the function is exited
T=inputbox ("Click the rule input:" Chr Chr () "1th representative engine room number" Chr () "2nd, 3 representative machine number" Chr () "Teaching Division 00 representatives " Chr () " such as: 123 on behalf of the 1th Room 23rd machine " Chr " Please make sure the input is correct!! "," Please enter 3-bit machine ID! "," ") ' Input machine name, default value is null
If t= "then" if T equals null (press t
There are n numbers, both of which are 0 at the beginning.
Add I, j to I, and Add 1 to all the numbers in the J range
Q I j asks the number of three divisible numbers between I and j.
Line Segment tree records three domains
Number of times the remainder of three is 0
..... 1 ......
..... 2 ......
It can be saved in an array.
Considering that each time we add 1 to an interval, the number of the numbers in the interval that take the remainder of 3 as 1 is changed to the number of t
in height betweenthe tallest and shortest cow in the range.Sample Input6 31734251 54 62 2Sample Output630SourceUSACO 2007 JanuarySilverSolution:This question can be done using the line segment tree. There are only two operations: the first to create a tree and the second to query the line segment interval.Code:# Include # Include # Include # Define N 50005# Derefined Q 200005Using namespace std;Struct segment{Int left;Int right;Int max;Int min;Int value;};Int n, q;Int high;Segment seg [N * 4];I
//1A b change the number of a position to b//0A b output [b] maximum sum of beautiful subsequence//a beautiful subsequence is a subsequence so all the adjacent pair S//of ElvesinchThe sequence has a different parity of position//maintenance Oto, OTE, ete, and Eto represent the largest beautiful subsequence of the parity case of this interval starting and ending points respectively#include #include #include #include #include #include #include #include Using namespaceSTD;#define MAXN 100100#define
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.