Weighted Line Segment Tree + Presidential Tree (Number of occurrences of a primitive in interval K or sub-interval)
Firstly, a chair tree is used to find the board with the smallest interval K.
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define mid (l+r)/2
using namespace std;
const int N = 1e6+4;
int L[N<<5],R[N<<5],sum[N<<5];
int a[N],b[N],T[N ...
Added by rulian on Fri, 11 Oct 2019 18:48:26 +0300
Subequence 1 [Linear DP + Combination Number]
Give you two strings S and t consisting of numbers (character'0'SIM' 9'). The length of S is n, and the length of T is m. The first character of S and t is not'0'. If considered a positive integer, count the number of valid subsequences of s greater than t. The subsequence is valid only if and only ...
Added by WinnieThePujols on Thu, 10 Oct 2019 19:18:12 +0300
Codeforces 1198C Matching vs Independent Set
Portal
Idea: The way to find a matching set is greed. For edges (u,v), if u and V are not covered by other edges already in the set, then add edges (u,v) to the set, and finally determine whether the number of edges in the set is greater than or equal to n. If it is greater than or equal to n, it ca ...
Added by lances on Thu, 10 Oct 2019 19:06:11 +0300
Analysis of System File and Directory Management in CentOS 7
Linux directory structure
Linux directory structure is a tree-like directory structure
root directory
The starting point of all partitions, directories, files, etc.
In the entire tree directory structure, a separate "/" is used.
Common subdirectories
Catalog
Directory name
Catalog
Directory name
/root
Administrator's Home Direc ...
Added by wombatee on Thu, 10 Oct 2019 16:06:09 +0300
Implementation of linked list in java
1. Overview of single linked list
The linked list is stored in the way of nodes, it is chain storage.
Each node contains a data domain, next domain: point to the next node.
The nodes of the linked list are not necessarily consecutive storage
The linked list with sub-header nodes and the linked l ...
Added by lilbadger25 on Thu, 10 Oct 2019 02:09:10 +0300
Learning JavaScript Data Structure and Algorithms (Chapter 8) (Trees)
1. Binary search tree (two conditions):
(1) There are at most two sub-nodes in the binary tree: one is the left node, the other is the right sub-node.(2) Only values smaller than the parent node are allowed to be stored in the left node, while values larger (or equal to) are allowed in the right node.
2. Code Architecture:
It mainly includes in ...
Added by Xu Wei Jie on Wed, 09 Oct 2019 23:44:13 +0300
The Use of aspect-ratio Width-to-Height Ratio in less for css Media Queries
css media query has a aspect-ratio, which can be used directly for page adaptation.
// Width-to-height ratio is within ((320/50)+(728/90)/2 of the median of two sizes to fit 320*50 design pattern.
@media screen and (min-aspect-ratio: ~"249/50") and (max-aspect-ratio: ~"29/4"){
@base: 320;
@convert: 375/@base;
.c ...
Added by jamie85 on Wed, 09 Oct 2019 09:01:46 +0300
svelte tutorial logic
Conditional logic
Conditionally render some elements, using the "if" code block:
<script>
let user = { loggedIn: true };
function toggle() {
user.loggedIn = !user.loggedIn;
}
</script>
{#if user.loggedIn}
<button on:click={toggle}>
Log out
</button>
{/if}
Using else code bl ...
Added by FrankA on Wed, 09 Oct 2019 04:18:08 +0300
HDU-3791 Binary Search Tree
Topic link: https://cn.vjudge.net/contest/317394#problem/A
Judging whether two sequences are the same binary search tree sequence
Input
Beginning with a number n, (1 <= n <= 20) means there are n judgements to be made, and the input ends when n= 0.
The next line is a sequence with a length less th ...
Added by enemeth on Wed, 09 Oct 2019 01:21:16 +0300
MySQL optimizer: introduction to index merge - Database, Cloud Computing and Life
In MySQL's official manual, about Introduction to index merge Very few. There are even many misleading places. This time, I have looked over the code of version 5.1 about this kind of optimization processing, and introduced various practical index merge access types of SQL in a case-by-case way. Subsequently, we will continue to introduce the m ...
Added by genetheblue on Tue, 08 Oct 2019 13:41:24 +0300