Canada S-1 Earth Drilling RIG-the world's lightest soil sampling rigCanada S-1 Earth Drilling Rig is the most portable, fast, efficient and convenient soil sampling rig, it can replace large hydraulic and electric drilling rig, the Canadian Geotechnical Engineering Association has been highly recommended, and become th
Realization function: With balance tree treap 1 (bzoj3224/tyvj1728)This template has a lot of improvements, obviously more beautiful, almost every part has a lot of simplification, especially the deletion of the section, this reference to the Hzwer god Ben Writing, in this acknowledgement, and then, paste template to leave1 var2 I,j,k,l,m,n,head,tot:longint;3A,b,lef,rig,fix:Array[0..100010] ofLongint;4 functionmin (x,y:longint): Longint;5 beg
storage of a line segment tree is a bit similar to that of a binary tree. The left and right child nodes are required. In addition, to store the number of times each line segment appears, therefore, the counting element is usually added as follows:
[Cpp]Struct Node // line segment tree{Int left;Int right;Int counter;} SegTree [4 * BORDER];
Struct Node // line segment tree{Int left;Int right;Int counter;} SegTree [4 * BORDER];Left indicates the left endpoint, right indicates the right endpoint,
Data Structure of the Line Segment tree
From the figure above, we can see that the storage of a line segment tree is a bit similar to that of a binary tree. The left and right child nodes are required. In addition, to store the number of times each line segment appears, therefore, the counting element is usually added as follows:
1 struct node // line segment tree 2 {3 int left; 4 int right; 5 Int counter; 6} segtree [4 * border];
Left indicates the left endpoint, right indicates the right endp
be, so the child gently loose O (Nlogn) Water over (hansbug: My 220ms,phile god Ben 252ms good happy? * ^_^ *)1 var2 I,j,k,l,m,n,mt,head:longint;3A,lef,rig,fix:Array[0..1000000] ofLongint;4 functionmin (x,y:longint): Longint;inline;5 begin6 ifX ThenMin:=xElsemin:=y;7 End;8 procedureRtvarx:longint); inline;9 varF,l:longint;Ten begin One if(x=0)or(lef[x]=0) Thenexit; Af:=x;l:=Lef[x]; -l
template question. Directly set up a left-leaning tree to engage in ... (But I was the first to write the need to maintain the Father node left-leaning tree, it seems a little trouble, but also good, is more than a few statements)1/**************************************************************2Problem:14553 User:hansbug4 language:pascal5 result:accepted6Time:4028Ms7Memory:35384KB8****************************************************************/9 Ten var One I,j,k,l,m,n:longint; AA,lef,
time.SourceThe problem: After a long time, I saw this problem again = = This time I use the balance tree query, simple \ (O\left (n\log N \right) \), and the speed seems to be faster than the last hash1/**************************************************************2Problem:27613 User:hansbug4 language:pascal5 result:accepted6Time:1840Ms7Memory:2180KB8****************************************************************/9 Ten var One I,j,k,l,m,n,head:longint; AB:Array[0..100000] ofLongint; -Lef,
Very simple one problem, the results of the background data is wrong, I was too stupid card for 3 hours ...Test instructions: give you a string of number A and give you some interval (Lef,rig), find out A[lef]%a[lef+1]...%a[rig]The puzzle: We can find that the number A to the number B modulo: If aWe can use the line segment tree to find the first position in the interval less than a certain value, the metho
Topic Links:Codeforces 337DMain topic:Give a tree, give the infection range, give some identified the infected point, ask the number of points the infection may be placed.Topic Analysis:
Define state Dp[i] represents the distance at which a point reaches the identified point of infection farthest from it.
Then we first DFS again, the tree with 1 roots, each point to the maximum distance of the infection point in the subtree, and then DFS again, to obtain dp[i] the required value, us
restoration of node flag, as well as the very pit Dad's multi-group test ! (The Sound of WA is a piece of-.-)1#include 2#include 3#include string>4#include 5 using namespacestd;6 stringb;7 Charlef[ +],rig[ +];8 intflag[ +];9 intnum;Ten BOOLans; One voidSrhCharx) A { - for(intI=1; i) - { the if(lef[i]==xflag[i]==0) - { - if(rig[i]=='m') - { +ans=1; -
;And then! Something magical happened! I actually gave the inner layer to use the Division (manual Laughter Cry), and then tried to make it more complicated (manual goodbye), the only consolation is this exercise a bit of my thinking ability Orz, I think this division is very ingenious, so by the way posted up:#include #include#include#include#include#includestring>#include#include#includeSet>using namespacestd;intn,h[100005],ANS,MAXN;voidResintLefintrig) { if(lef>=
http://172.20.6.3/Problem_Show.asp?id=1547http://www.lydsy.com/JudgeOnline/problem.php?id=4566It seems that the suffix is a positive solution, but the suffix array + and check set can also mess with a off, define the string size of integer variables when char siz cause re or something; I'm probably a zz.By the way, save a board, copy Purple Xuan learn elder sister's board.1#include 2#include 3#include 4#include 5#include 6 using namespacestd;7 Const intmaxn=200010;8 Const intPl= -;9 intsa[maxn*2
Cool: 6 Interesting linux commandsTransfer from http://www.cricode.com/3388.html 1 PV command
Sometimes we see some subtitles on a movie screen that show up at a uniform speed, like someone knocking on the keyboard and showing the same side. The PV command on Linux can achieve this effect.By default, Linux does not have the PV command and needs to be installed on its own.First install the command:
# yum Install PV [on RedHat based Systems]
# sudo apt-get install PV [on Deb
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.