Hdu 1711 Number Sequence (KMP template)

# Include # include #define N 1000005 # define M 10005int a [N], B [M]; int next [M]; int n, m; void setNext () {int I, j; I = 0; j =-1; next [I] = j; while (I  

Write the simplest Bubble Sorting

Bubble Sorting is really very simple. Well, if you have 15 minutes, maybe you will write it out soon. Really, I believe in you, and maybe you may think about it quite well, here, I only use this blog to record the Bubble Sorting I know. Why is this

POJ1742: Coins (multiple backpacks)

Description People in Silverland use coins. they have coins of value A1, A2, a3... an Silverland dollar. one day Tony opened his money-box and found there were some coins. he decided to buy a very nice watch in a nearby shop. he wanted to pay the

Hdu 2612 Find a way (BFS)

# Include # include #include #include # define N 205 using namespace std; char map [N] [N]; int v [N] [N], ans1 [N] [N], ans2 [N] [N], d [4] [2] = {-}, {}, {0, -1 },{ 0, 1 }}; int x1, x2, y1, y2, n, m, num; struct node {int x, y, step; friend bool

Poj1562 -- Oil Deposits

Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. geoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. it

UVa10651 (memory-based search)

Question: For a string composed of-and o, you can change "-oo" to "o --", and "oo-" to "-- o ", the minimum number of o Records.   State compression, memory-based search Code:   #include #include #define len 12 #define min(a,b) (((a)#include

HDU 4628 Pieces

PiecesTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission (s): 337 Accepted Submission (s): 186   Problem DescriptionYou heart broke into pieces. My string broke into pieces. But you will recover one

Number of 1 in binary

    Method 1: judge whether the rightmost digit in the integer Binary Expression is 1, move the integer one to the right to determine whether the penultimate digit is 1, and so on until the integer is 0. Code: [Cpp]# Include "stdafx. h"# Include

Hdu1298-classic string

T9Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission (s): 1209 Accepted Submission (s): 477 Problem DescriptionA while ago it was quite cumbersome to create a message for the Short Message Service (SMS)

HDU 2041 super stair

Problem DescriptionThere is a total of M-level stairs. At the beginning, you are at the first level. If you can only cross the upper or second level at a time, how many steps should you go to the level M?  InputThe input data first contains an

Fig Dijkstra Algorithm

The C language is implemented as follows: (using the adjacent matrix storage) # include # include # define VERTEXNUM 6 // edge element that stores the shortest path, typedef struct edge {int vertex; int value; struct edge * next;} st_edge; void

Hdu1238 Substrings (violent)

SubstringsTime Limit: 2000/1000 ms (Java/Other) Memory Limit: 65536/32768 K (Java/Other)Total Submission (s): 10 Accepted Submission (s): 6Font: Times New Roman | Verdana | GeorgiaFont Size: bytes →Problem DescriptionYou are given a number of

The last k node in the linked list

Idea: set two pointers, a slow pointer pSlow, a fast pointer pFast, fast pointer first K-1 step, then two pointers at the same time, when the fast pointer to the end of the chain table, the slow Pointer Points to the nearest k node. Special case: If

Poj 2253 & amp; zoj 1942

FroggerTime Limit: 1000 MS Memory Limit: 65536 KTotal Submissions: 20716 Accepted: 6741 Description Freddy Frog is sitting on a stone in the middle of a lake. suddenly he notices Fiona Frog who is sitting on another stone. he plans to visit her, but

Hdu 3911 Black And White (line segment tree)

This question is very troublesome. What is annoying is that the question is actually nothing gold, that is, the delay mark plus range merge. At half past one yesterday evening, I got up and started to do this. From half past one to, submit wa. At

Poj-1873-The Fortified Forest

Give the coordinates of n trees, the height of the tree and the value of the tree. Cut some (the whole tree) from these trees and make a fence to enclose the remaining trees, minimize the value of the tree consumed. Output the desired tree and the

HDU1250: Hat's Fibonacci

Problem DescriptionA Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1.F (1) = 1, F (2) = 1, F (3) = 1, F (4) = 1, F (n> 4) = F (n-1) + F (n-2) + F (n-3) + F (n-4)Your task is

The longest-circuit and full-Line brute-force method of the Getting in Line in the uva 216

A discrete vertex is given, and a shortest path connecting all vertices is required. A maximum of 8 points, decisive use of violence. Use next_permutation to list all rows, calculate the outbound route, and record the shortest path. This problem can

Hdu 4608 brute force large number

# Include # include # include # include using namespace std; char a [100020]; int main () {int T; cin> T; while (T --) {int sum = 0; scanf ("% s", a + 1); a [0] = '0 '; int len = strlen (a); for (int k = 1; k ++) {int s = a [len-1] + 1-'0'; int

Hdu 1241 Oil Deposits (dfs)

Oil DepositsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission (s): 7813 Accepted Submission (s): 4583   Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting

Total Pages: 5902 1 .... 5508 5509 5510 5511 5512 .... 5902 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.