Logue P4563 [JXOI2018] guard (dp)
meaning of the title
Title Link
Sol
A very interesting topic.
We set \ (f[l][r] \) to represent the answer of interval \ ([l,r] \).
Obviously there must be a bodyguard at \ (r \)
At the same time, it is not difficult to observe a property: take \ ([1, n] \) for example, if a certain interval it cannot observe is \ ([l_k, r_k] \), then \ (r_k \) ...
Posted by GreyBoy on Sat, 30 Nov 2019 13:00:49 -0800
Logu P4425 [HNOI/AHOI2018] turntable (line segment tree)
meaning of the title
Title Link
Sol
First of all, guess a conclusion: for each query, it must be optimal to enumerate a starting point and wait until a certain point appears before going to the next point.
It can't be proved. I took 3w group in the examination room. That's right...
First, it is convenient to enumerate the starting point by doub ...
Posted by ziggs on Sat, 30 Nov 2019 03:57:54 -0800
C + + member objects and enclosing classes
01 member objects and closed classes
If there are other objects in a class, the object is called a member object; if there are member objects, the class is called a closed class;
class CTyre // Tyres
{
public:
// Parametered constructor
// Initializing member variables m radius and m width
CTyre(int r, int w):m_radius(r),m_width(w) ...
Posted by lm_a_dope on Fri, 29 Nov 2019 06:19:34 -0800
Efficient algorithm -- binary search
Today I got a lot of new knowledge. share it with you.Binary searchFor example, when I bought a pair of shoes, you asked me how much it was. I said it was no more than 300 yuan. You're still curious. If you want to know how much, I'll let you guess. How would you guess?Answer: you guess the middle number every time.Right, so we usually guess t ...
Posted by sonofyoda on Mon, 25 Nov 2019 09:55:06 -0800
Introduction to C + + to understanding phase II Basic chapter -- C + + structure
1. overview
We have learned that c + + has built-in common data types, such as int, long, double, etc., but if we want to define a student's data type, c + + doesn't have one. At this time, we need to use the structure, in other words, the structure can help us define our own data types.
2. Structure definition and use
Format struct structure n ...
Posted by michaelphipps on Fri, 22 Nov 2019 09:27:31 -0800
virtual Function Pure virtual Function virtual Base Class in C++.
Foreword: To understand the differences among the three, three essential conditions for polymorphism must be mastered:
inherit
heavy load
The parent pointer points to the child class object.
Virtual function pure virtual function virtual base class
1. virtual functions are used to modify parent functions in polymorphisms to ensure that su ...
Posted by cockney on Wed, 20 Nov 2019 13:40:47 -0800
Data structure linear table (sequence table, single chain table)
Linear table
1. Meaning of linear table
linear list is a finite sequence of n data elements with the same characteristics Linear table is a kind of data structure widely used in practice. Common linear table: sequence table, chain table, stack, queue, string... Linear table is a linear structure in logic, that is to say, a continuous line. But ...
Posted by bigswifty on Tue, 19 Nov 2019 04:12:56 -0800
The eighth day of FRR learning -- Distributed symmetric gateway
Distributed symmetric gateway
spine configuration
bgp evpn configuration
router bgp 7677
bgp router-id 192.168.59.130
bgp bestpath as-path multipath-relax
neighbor fabric peer-group
neighbor fabric remote-as external
neighbor 192.168.59.128 peer-group fabric
neighbor 192.168.59.129 peer-group fabric
!
address-family l2vpn evpn
neighb ...
Posted by Bunkermaster on Tue, 19 Nov 2019 01:26:44 -0800
P2057 [SHOI2007] vote in good faith (maximum flow)
subject
P2057 [showi2007] vote in good faith
analysis
The modeling of network flow is so ingenious.
We regard the agreed opinion as the source point \ (s \), and the disagreed opinion as the sink point \ (t \).
Then we \ (s \) connect to all the people who agree and \ (t \) connect to all the people who disagree. The traffic volume is 1, which ...
Posted by myharshdesigner on Mon, 18 Nov 2019 12:19:42 -0800
SP375 QTREE - Query on a tree
subject
SP375 QTREE - Query on a tree
analysis
It's also a blue question, because it's longer
Tree cut open questions (basically), single point modification, chain query.
We can see that in this problem, we operate on the edge, and our tree section operates on the nodes, so we consider to transfer the edge weight to the point weight.
It is foun ...
Posted by Piranha on Sun, 17 Nov 2019 13:37:58 -0800