Hdu1520
It is much simpler than the previous tree-shaped backpack, without the size limit of the backpack
The maximum value obtained from the tree where DP [I] [0] uses I as the root (excluding I itself)
The maximum value obtained from the
/* HDU 3265 posters line segment tree + scanning line use some rectangular posters with rectangular holes in the middle to paste the area covered by the window text line segment tree + scanning line you can simply look at the scanning line, this is
/* Question: machine A has n (0 ~ N-1) mode. Machine B has m (0 ~ M-1) mode, there are K tasks to be done first. You can use the AI mode of machine A or the Bi mode of machine B to do tasks without sequence. Restart the tasks in order of mode change,
# Include # include # include using namespace STD; Map m; void INI () {M ["A"] = ""; m ["A #"] = "BB"; m ["BB"] = "#"; M ["B"] = ""; m ["C"] = ""; m ["C #"] = "DB "; M ["DB"] = "C #"; m ["D"] = ""; m ["d #"] = "Eb "; M ["Eb"] = "d #"; m ["E"] = "
/* The minimum vertex coverage and the maximum independent set of the Bipartite Graph can be converted to the maximum matching solution. On this basis, each vertex is assigned a non-negative weight value. The two problems are transformed into: the
Hdu2824
Filtering versions of Euler's formula templates
# Include # define Max 3000000 using namespace STD ;__ int64 E [Max + 10]; void Init () // template {int I, j; memset (E, 0, sizeof (e); e [1] = 1; for (I = 2; I B) Swap (a, B);
/* The maximum number of input values is the power of 2 to the power of 32. Therefore, all outputs # include int main () {__ int64 B, BB; int I, j; while (scanf ("% i64d", & B), B) {Double Z, ZZ; int X, Y; If (B = 1) {printf ("1 \ n"); continue;}
# Include int map [9] [9], Kong [90] [2], kN; int CI = 0, F; int he (int I, Int J, int K) // judge whether K can be entered. The value cannot be {int o, p, Oo, pp; For (O = 0; O
/* Question: someone takes photos of M beauty in N days. Each beauty has a minimum requirement. Each day, there is a maximum number of photos. n m is given first. Each beauty has a minimum of N. {the number of beautiful women taking photos on I day.
/* First obtain the shortest path from each point to 1 and then find the prototype of the maximum value from the Shortest Path: int atoi (const char * nptr). Function Description: The nptr parameter, if the first non-space character does not exist
/* The median of the interval can be converted to the kth value. Therefore, the previous function is directly applied to the partition tree. */# include # include using namespace STD; const int n = 100010; int srted [N]; struct node {int num [N];
/* The question of poj 1654 area polygon area is very simple, but 1000000 of the points cannot be opened */# include # include # include const int n = 1000000 + 10; const double EPS = 1e-8; struct point {Double X, Y; point () {} Point (double A,
# Include # include # include using namespace STD; int S, T; struct node {int X, Y;} Shu [40001]; node SS, TT; int Suy [40001]; int map [201] [201]; int Fang [201]; void inif () // calculates the number of workers {for (INT I = 1; I q; qnode Cur,
/* 2-Sat question: m doors. Each door has two locks. You can use 2n keys to open one, and each of them is tied together, only one question can be selected. How many doors can be used at most? 2-The key graph of the SAT issue. 2-the SAT has two
/* Problem: Given a sequence consisting of n integers (which may be negative integers) dat1, dat2 ,..., Datn, and a positive integer m, must determine m non-Intersecting child segments of the sequence, so that the sum of the M child segments reaches
Pku3041-Asteroids
View rows and columns as points
Using the Hungary Algorithm
# Include # include # include using namespace STD; bool MP [500] [500], visit [500]; int link [500]; int M, N; bool find (int x) {int I; for (I = 1; I
This question seems to be a mathematical question. It is easy to think about it.
/** Hdu-1050 * Mike-W * 20120-4-8 ************************** * *********************** each movement is regarded as a line segment drawn from S to T, then the minimum *
HDU 1875 smooth engineering recontinued
Data in the adjacent matrix must be fully initialized.
# Include # include using namespace STD; const double INF = 1000000000.0; double MP [100] [100]; struct point {int X, Y;} p [100]; double prim (int
Pku2488
Inexplicably passed ......
1. Board Layout
2. output sequence
3. the direction indicated by the Dir Array
#include#include#includeusing namespace std;int m,n,flag,dir[8][2]={{-1,-2},{1,-2},{-2,-1},{2,-1},{-2,1},{2,1},{-1,2},{1,2}};bool mp[
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service