Ultraviolet A 11624 Fire! (Secondary BFS)

The minimum fire time of each point is obtained after a BFS fire is first performed. The minimum time for reaching the boundary is obtained again for the human BFS.   # Include # include # include using namespace std; int n, m, bz [1005] [1005],

Shortest-Dijkstra algorithm-HDU1790

// Dijkstra # include # include # include # include # include # define INF 0x3f3f3fusing namespace std; struct node {int d, p;} mat [1005] [1005]; int main () {int x, y, n, m, a, B, s, t, i, j, k, d [1005], p [1005], minsd, minsp, visited [1005]

C ++ Implementation of Singleton Pattern

# Include # include using namespace std; class Singleton {public: static Singleton * GetInstance (); void print (); void write (string strTmp); private: singleton (); static Singleton * instance; string str ;}; Singleton: Singleton () {str = "Test"

Hdu4709 Triangle Area

HerdingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission (s): 702 Accepted Submission (s ): 174 Problem DescriptionLittle John is herding his father's cattles. as a lazy boy, he cannot tolerate chasing

URAL 1018 (Golden Tree DP)

Connection: 1018. binary Apple TreeTime limit: 1.0 secondMemory limit: 64 MBLet's imagine how apple tree looks in binary computer world. you're right, it looks just like a binary tree, I. e. any biparous branch splits up to exactly two new branches.

C ++ compilation links

Several concepts to be understood: 1. Compile: the compiler compiles the source file, which is the process of translating the source code in the text form in the source file into the target file in the form of machine language, in this process, the

Ultraviolet A 10934 Dropping water balloons (dp | hard to think about)

You have k exactly the same water polo in a building on n floors, you want to know the water polo from a few floors down the drop can let the water polo broken. Because you are very lazy, you want to lose the ball at least times to measure the

Poj 2356 pigeon cage principles

(It should be noted that the code I wrote outputs the result when there is an answer, but OJ also reads the result from the file, so at first glance, it seems that there is a result when I have not entered it, but I don't know about OJ. In fact, I

Uvc camera code parsing 5

8. initialize uvc control 8.1 important struct [cpp] struct uvc_control {// uvc controls struct uvc_entity * entity; // uvc entity struct uvc_control_info info; // uvc control information _ u8 index; // index value _ u8 dirty: 1, loaded: 1, modified:

Simple selection and sorting

# Include # include void display (int * a, int n) {assert (a); for (int I = 0; I # Include # include // exchange two data void swap (int * a, int * B) {int temp; temp = * a; * a = * B; * B = temp ;} // display the exchanged array void

Delete a specific character from a string

#include#include#include#includevoid Delete_specific_char(char * str1, char * str2){ char * phash = (char *)malloc(sizeof(char)*256); assert(phash); memset(phash, 0, 256); int i = 0; while(str2[i] != '\0' ) { phash[str2[i++]] =1; }

UVA1351 ----- String Compression ----- interval DP (memory-based search implementation)

According to his idea, the algorithm is self-implemented to give a string, which can be abbreviated to k (S) form for the same continuous part, and S is a string, k indicates that there are consecutive identical S. For example, abgogogogo can be

HDU Network Competition (Hangzhou Division) 1003 (13.09.15)

Problem DescriptionThere was no donkey in the province of Gui Zhou, China. A trouble maker shipped one and put it in the forest which cocould be considered as an N × N grid. the coordinates of the up-left cell is (), the down-right cell is (N-1, N-1)

Starting from sorting (2) Hill sorting

Hill sorting is an improved version of direct insertion sorting, also known as incremental reduction sorting, which is essentially a sort of group insertion. The basic idea is to first take the first incremental step, and take the elements with

Start from sorting (3) Merge Sorting

Merge Sorting is an effective Sorting Algorithm Based on merge operations. This algorithm is a very typical application of Divide and Conquer. The merge operation process is as follows: 1. apply for a space so that the size is the sum of two sorted

Hdu-4745-Two Rabbits

Question: two rabbits jumped on n blocks of a ring Stone. Each stone had a weight of ai. One jumped from left to right, and the other jumped from right to left, for each hop, the weights of the stones where the two rabbits are located must be equal

UV 11401-Triangle Counting)

Question: from 1 ~ 3 integers are selected from n so that they can form a triangle on the three sides. Given an n, how many different triangles can they form? Question: n can reach a maximum of 1000000, so it can only be solved by O (n. The number

Trie tree query based on C/S architecture

1. simulate a score query system. The user enters the name and returns the corresponding score. The entire Query Process is run on the server and the Trie tree is used to accelerate the query. Code 2 server: #include #include #include #include

Two-dimensional array --- maximum values of two numbers and

Problem: given a two-dimensional array, find two numbers to make them the largest, requiring these two numbers to be different rows and columns. Solution: converts a two-dimensional array to a one-dimensional array. The length of the one-dimensional

Zoj2588 Burning Bridges (undirected Bridge)

For an undirected graph, remove some edges so that the graph is still connected and the edges cannot be removed. Question Analysis: it is to find a bridge without a directed graph. The tarjan algorithm runs once and is very similar to an undirected

Total Pages: 5902 1 .... 5896 5897 5898 5899 5900 .... 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.