C + + random number engine

The random number engine of C + + has the following points to note: 1. Random number generator using the same seed will generate random number sequence of the same sequence 2. To make the program generate different random results every time it runs, we can use time(0) to generate a random number seed 3. We must pass the engine itself to the ...

Posted by Candrew on Mon, 09 Dec 2019 02:47:07 -0800

PTA stack (bracket matching)

#include<bits/stdc++.h> using namespace std; #define STACK_INIT_SIZE 10000 #define STACKINCREMENT 10 #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define INFEASIBLE -1 #define OVERFLOW -2 using namespace std; typedef char SElemType, Status; typedef struct { SElemType *ba ...

Posted by yumico23 on Sun, 08 Dec 2019 11:28:36 -0800

Group queue UVA540 Team Queue

Title Description There are t teams in a long line. Every time a new player comes in, if he has teammates in line, the new player will jump behind the last teammate. If there is no team mate in line, he will be placed at the end of the long line. Enter the number of all team members in each team, and support the following 3 instructions: ENQUEU ...

Posted by balloontrader on Sun, 08 Dec 2019 09:47:24 -0800

General dll technology

The principle is very simple: your own dll loads the hijacked dll. Through the loadlibrary, but you replace the dll, peb saves the handle of your current dll. When you call it, you call the dll. It's definitely not possible that only the original one is hijacked, and it's impossible to implement all the functions once. The way is to take the h ...

Posted by Tensing on Sun, 08 Dec 2019 04:51:15 -0800

LOJ Chen 2509. Arrangement of "AHOI / HNOI2018" (thinking set)

meaning of the title Title Link Sol Fairy question Orz First of all, it's not hard to see that if we connect an edge from \ (a \) to \ (i \), we will get a tree with \ (0 \) as the root (because each point must have an entry, and the presence of a ring indicates that there is no solution). At the same time, we need to ensure that the father nod ...

Posted by vamosbenedikt on Sun, 08 Dec 2019 01:27:41 -0800

[C + +] 35 μ function object analysis

customer demand Write a function Function to get the value of each term of Fibonacci series Return one value per call Functions can be reused as needed Programming experiment: the first solution #include <iostream> using namespace std; int fib() { static int a0 = 0; static int a1 = 1; int ret = a1; a1 = a0 ...

Posted by garry27 on Sat, 07 Dec 2019 17:35:05 -0800

bzoj2253 carton stacking

Title Link meaning of the title Finding strictly ascending subsequence of triples thinking Consider violence first for(int i = 1;i <= n;++i) for(int j = 1;j < i;++j) if(x[i] > x[j] && y[i] > y[j] && z[i] > z[j]) f[i] = max(f[i],f[j] + 1) Consider using \ (CDQ \) divide and conquer to optim ...

Posted by everlifefree on Sat, 07 Dec 2019 14:26:57 -0800

#leetcode 30 - concatenate all word substrings

Given a string s and some words of the same length. Find out the starting position of a substring in s that can be formed by concatenating all words in words.Note that the substring should exactly match the words in the words, and there should be no other characters in the middle, but the sequence of words in the words should not be considered. ...

Posted by djcee on Sat, 07 Dec 2019 13:47:19 -0800

BZOJ2655: calc(dp Lagrange interpolation)

meaning of the title Title Link Sol It's not hard to think of a dp first Set \ (f[i][j] \) to indicate that \ (I \) strictly increasing schemes with the maximum number of \ (j \) are selected When transferring, judge whether the last position is \ (j \) \[f[i][j] = f[i][j - 1] + f[i - 1][j - 1] * j\] for(int i = 0; i <= A; i++) f[0][i] = 1; ...

Posted by Alzir on Sat, 07 Dec 2019 12:02:55 -0800

BZOJ4011: [HNOI2015] falling memory Fengyin (dp multiplication principle)

meaning of the title Title Link Sol A wonderful question Set \ (inder[i] \) to represent the degree of \ (I \) node First of all, if it is a DAG, you can consider selecting an edge from the incoming edge of each point as the edge on the tree graph, so \ (ANS = \ prod {I > 1} inder [i] \) If an edge is added, the contribution of some rings (s ...

Posted by valshooter on Sat, 07 Dec 2019 09:56:30 -0800