[Hash function] // 1. the first hash method is typedef long ll; const int hashmax = 1000003; ll hash [hashmax]; // y, W is the two values to be hashed int makehash (INT y, int W) {ll situ = (LL) Y
This question can be used to practice coding!
CodeAs follows:
/* ID: Guo geerprog: heritagelang: c ++ */# include # include # include # include # include using namespace STD; struct node {char V; node * left; node * right;}; int Len; char
1. degree sequence of a graph
Definition: If V (G) = {V1, V2, V3 ,..., VP}; it is called a non-negative integer sequence (D (V1), D (V2), D (V3 ),..., D (VP) is the degree sequence of graph G. (a graph in the definition refers to a generalized
I haven't written any questions for a long time ...... Haha!
This is a DP problem, which is relatively simple!
The Code is as follows:
/*ID: guo geerPROG: game1LANG: C++*/#include#include#include#includeusing namespace std;int dp[210][210];int
This is also a simple graph theory problem!
You can use the Floyd algorithm!
Haha ......
Good code:
/*ID: guo geerPROG: butterLANG: C++*/#include#include#include#includeusing namespace std;#define MAXN 10000000int pas[1000];int dist[1000][1000];int
This... practice search... I can't write my own hash... sad reminder...
/********************HDU 4277Sevenster2012.09.12********************/#include#include#include#include#define HashSize (1se;bool judge( int a,int b,int c ){ if(
For the first time, I wrote a program in ubuntu, and after a long time, I was able to write something. From Installing the operating system, compiling the software, compiling the environment...
I feel like I am weak...
I have been calling a question
This question is relatively simple.
However, pay attention to the following special situations:
Also, remove the intersection points.
The Code is as follows:
/*ID: guo geerPROG: fence9LANG:
E. Cubestime limit per test
1 secondMemory limit per test
256 megabytesInput
Standard inputOutput
Standard output
Let's imagine that you're playing the following simple computer game. The screen displaysNLined-up cubes. Each cube is painted
I did not write this article because I think there are too few materials for the longest public subsequence,
It was such a familiar problem that I finally found the bug after WA all morning,
Lessons learned from the morning's pain: as a programmer,
Super Password
Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission (s): 1618 Accepted Submission (s): 489Problem DescriptionIgnatius spent a week finally finding the legendary treasure where the
M people are on the south bank of a river w in width. Now they are going to the opposite side. It is known that there are n stones in the river. Each rock can only accommodate ci people at the same time, each person can jump to the distance d at a
Click to open the question link. There is also a similar question, which only performs the 01 flip operation and the maximum continuous query, HDU3911Black And White
Perform the following operations on a sequence:
Change operations:
0 a B change all
Q: a n * N big cake was interrogated M times. Each time a rectangle was cut, I asked how many blocks were divided into each cut rectangle (1
Solution: it is clear that the number of connected components in a region is obtained. Because the elements
Question: Give 200 numbers and select the largest subset so that the numbers in the subset do not divide each other.
Solution: Split the vertices and edges that can be divisible. It looks like the largest independent set of an undirected graph. The
City 1 is the starting point and city n is the destination. There are several restrictions: you must first take City a to take City B. Ask the shortest time required to take city n.
The shortest path from the source point to any point is restricted
1. (strict) generation of small trees
Solution: 1. delete the edges in the tree in sequence and then obtain the minimum spanning tree. When determining that the Spanning Tree is unique, you only need to delete the edges with the same length as the
Click the open question link to perform three operations and inquiries on consecutive villages.
D x:X-Th village was destroyed.
Q x: The Army commands requested the number of commands ages thatX-Th village was directly or indirectly connected
Question: Give a tree. Each vertex has a vertex weight. Then, ask how many kinds of weights of the Child tree with x as the root appear exactly k times.
I am too lazy to answer questions directly. Besides, I did not write it myself.
#include
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