Flying sheep LCT

Intention:

There are a total of n positions, one attribute k[i] for each position, indicating that the i position will be instantaneously transferred to i+k[i] (and then transferred in turn). Ask how many times out of a point will go out of bounds. And support for modifying k[i].

answer:

I move i to i+k[i] and if i+k[i] is out of bounds, it will connect to the outer root. Asking is asking for depth.

After a node is splayed to the root (provided that the root is the root of the original tree), the left side must be shallower than it (and must be a chain to the root of the original tree (because of the access operation)), so the left son Size is its depth (the depth of the root is 0).

Actually, I had to write a day of LCT for half an hour to write it, if it is not BZOJ's compiler stack space is not enough 1A

/************************************************* *************

Problem: 2002

User: Lazer2001

Language: C++

Result: Accepted

TIme: 1988 ms

Memory: 22324 kb

************************************************** **************/

# include 《bits/stdc++.h》

Inline int read ( ) {

Register int x, c ;

While ( isspace ( c = getchar ( ) ) ) ;

For ( x = -48 + c ; isdigit ( c = getchar ( ) ) ; ( x *= 10 ) += c - 48 ) ;

Return x ;

}

Template " class T " inline T min ( const T& a, const T& b ) { return a " b ? a : b ; }

Template " class T " inline void swap ( T& a, T& b ) { T c ( a ) ; a = b, b = c ;

# define N 200010

Class LinkCutTree {

Private :

Struct node {

Int siz ;

Bool rev_flag ;

Node *ch [2], *fa ;

Inline void update ( ) {

Siz = ch [0] - " siz + ch [1] - " siz + 1 ;

}

} pool [N "1", *root [N], *null;

Int n ;

Inline void push_down ( node*& p ) {

If ( p -》 rev_flag ) {

Swap ( p - " ch [0], p - " ch [1] ) ;

If ( p - " ch [0] != null ) p - " ch [0] - " rev_flag ^= 1 ;

If ( p - " ch [1] != null ) p - " ch [1] - " rev_flag ^= 1 ;

p - " rev_flag = 0 ;

}

}

Inline node* newnode ( node*& fa ) {

staTIc node* tp ( pool + 1 ) ;

Tp - " siz = 1 ; tp - " rev_flag = 0 ;

Return tp -》 fa = fa, tp -》 ch [0] = tp -》 ch [1] = null, tp ++ ;

}

# define isroot( p ) ( p - " fa == null || ( p - " fa - " ch [0] != p && p - " fa - " ch [1] != p ) )

# define isrs( p ) ( p == p -》 fa -》 ch [1] )

Inline void rotate ( node* p ) {

If ( p == null || isroot ( p ) ) return ;

Bool d ( isrs ( p ) ) ;

Node* par = p -》 fa ;

Par -》 ch [d] = p -》 ch [! d] ;

If ( p - " ch [! d] != null ) p -》 ch [! d] -" fa = par ;

If ( ! isroot ( par ) ) par - " fa - " ch [ isrs ( par )] = p ; // ! Isroot(par)

p - " fa = par - " fa ;

Par -》 fa = p ;

p -》 ch [! d] = par ;

Par - " update ( ) ; p - " update ( ) ;

}

Node* st [N "1";

Inline void splay ( node* p ) {

If ( p == null ) return ;

// staTIc node* st [N "1] ; staTIc int tp ( 0 ) ; RE! ! ! !

Int tp ;

St [tp = 1] = p ;

For ( node * t = p ; ! isroot ( t ) ; t = t - " fa ) st [++ tp] = t - " fa ;

While ( tp ) push_down ( st [tp --] ) ;

While ( ! isroot ( p ) ) {

If ( isrs ( p ) == isrs ( p - " fa ) && ! isroot ( p - " fa ) ) rotate ( p - " fa ) ;

Rotate ( p ) ;

}

}

Miner Accessories


Immersion Cooling is a technique used to cool components of IT equipment that consists of submerging the computer components in a thermally conductive and dielectric liquid. Through this practice, the servers are cooled and heat is transferred from the source to the liquid.

When we talk about Immersion Cooling, we also need to discuss the different types of Immersion Cooling, as well as the applications of Immersion cooling. The practice of Immersion Cooling has a multitude of benefits particularly as it allows datacenters to be managed in a greener and more sustainable manner. Environmental concerns has been a huge catalyst for the adoption of the technology in recent years.


With Immersion Cooling the heat is transferred directly from the heat source to the working fluid. In [watercooling" the working fluid is potentially harmful to electronics and thus flows through a sealed loop isolated from the heat source. A watertight waterblock is used to indirectly transfer the heat from the heat source to the working fluid. With Immersion Cooling the working fluid must be non-conductive and that generally limits us to four families of fluids:

deionized water
mineral oil
fluorocarbon-based fluids
synthetic
Immersion Cooling systems used to have a higher fluid cost than water cooling, but this is already changing.

A wide variety of liquids exist for this purpose, the most suitable being transformer oils and other electrical cooling oils. Non-purpose oils, including cooking, motor and silicone oils, have been successfully used for cooling personal computers


water cooling,oil cooling,immersion cooling box,liquid immersion cooling,apw12 power supply

Shenzhen YLHM Technology Co., Ltd. , https://www.sggminer.com