Poj 3006 Dirichlet's Theorem on arithmetic sions ssions (prime number table)

// Simple question. Use the 'distinct' method to create a prime number table. # include using namespace STD; const int maxp = 1100000; bool isprime [maxp]; int prime [maxp]; void primelist () { memset (isprime, true, sizeof (isprime ));

Sicily 1097 led modding)

// It is hard to understand the meaning of a simulated question. // you can find the resistance that meets the conditions in a circuit, enables LEDs to emit light and do not exceed the rated voltage of the ledtube // associate the resistance value

Poj 2817 wordstack (State compression DP)

# Include # include # include using namespace STD; int POW [15]; int DP [1 char word [15] [25]; int W [15] [15]; void Init () { int W; memset (W, 0, sizeof (w); for (INT I = 0; I { for (Int J = 0; j { if (I = J) continue; int len1 =

Sicilly 1194 message flood (Dictionary tree + SEARCH)

// Search + dictionary tree (trie) // Wikipedia introduction to the dictionary tree // trie, also known as the word search tree, it is a tree structure and a variant of the hash tree. // a typical application is to count and sort a large number

Poj 3274 gold balanced lineup (hash)

// Hash // you can't imagine that hash can be used in such a place. You need to convert the problem, I wrote a report only when I read the report. // The question is the longest scope, in this range, various featrue appear the same number of times

Sicily 1426 phone list (trie tree)

// Trie tree // construct a trie tree for each number, identify by status # include # include using namespace STD; struct node { node * num [10]; int status; // status = 1 indicates that the phone number already exists at this node, and 2

Poj 1364 King (differential constraint system)

// Differential constraint system // The question is rather obscure. After reading the question for a long time, I will probably know what it is. // for the given Si, Ni, KI, and a given sequence s [1 .... n] // If (Si, Ni, GT, KI), the

Poj 1386 play on words (judge the existence of Euler's loop)

// Calculate the Euler's loop and pay attention to the nature of the European Union. // the idea of the diagram is to use the first letter and last letter of a word as the node diagram, use a word as a directed edge // (a) ---- ACM ------> (m) ----

Poj 1157 little shop of Flowers (Dynamic Planning)

// Dynamic planning // set S [I, K] to indicate that the I-th bouquet is placed in any vase before K (including K, the maximum aesthetic value (SUM) available for the first I bouquet // The optimal value of the original problem is s [F, v] // s

Poj 1102 LC-Display (simulation)

// Simulate the question // divide each number from top to bottom into 5 parts, and divide the print into 5 types // 1: blank 2:-3: left | 4: Right | 5: | two vertical bars, at the same time, set the printing interface for five parts // then the

Poj 1657 distance on chessboard (search question)

// Search questions. The King uses wide search to solve the problem, and then uses the point slope to solve the problem. There are only two cases: 1 or 2. // the vehicle can be determined in a straight line, either 1 or 2. // determine the black

Poj 2455 secret milking machine (Binary answer + maximum Stream)

Thanks to the classic questions provided by Huai Ge, I have learned the idea of a second answer! // The second answer + the largest stream // finally, I have seen the second answer in the legend. // if there is no second answer, how can I not

Poj 2488 a knight's journey (DFS-Knight's Travel problem)

// It must be output in Lexicographic Order, so note the search order // the last row cannot be left blank. // alas, it takes so long to search, it is too weak to have wa for so many times. # include using namespace STD; int case, X, Y; bool

Sicily 1823 hardest job ever! (Single-source shortest path)

// Single-source shortest path // Dijkstra + priority queue implementation # include # include # include # define INF 1200000000 # define maxn 205 # define maxm 20005 using namespace STD; typedef pair dis_v; // use a pair type to store

Zoj 3368 trick or treat (second answer)

// The result is a binary answer. Note that the accuracy must be 1 E-5, and you do not need to use the same content as the sample. // The question is to find a point (x, 0) minimize the maximum distance between other points # include # include

Poj 3311 hie with the pie (Floyd + state compression DP)

// Floyd + state compression dp // n cities (1 ~ N) a pizza store (0) requires a loop. It starts from 0 and returns to 0, and the distance is the shortest // that is, The TSP (traveling salesman) problem, first, it is not difficult to use Floyd to

Poj 1050 to the max (dynamic planning -- finding the maximum submatrix and)

DescriptionGiven a two-dimenstmarray of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. the sum of a rectangle is the sum of all the elements in that rectangle. in

Compilation error Summary

During programming, I often encounter some compilation errors, which I have encountered. I went to Baidu and Google for a long time and found them. Now I have sorted them out so that I can find them later...Unified format:Id. [error prompt]: the

STL hasp_map learning notes

1. Hash function declaration Problems Template , class _EqualKey = equal_to,class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >class hash_map{ ...} That is to say, in the above example, there are the following equivalent relationships: ...Hash_map

Lexical analyzer (1. Binary sorting tree)

//////////////////////////////////////// //////////////////////////////////// Fundamentals of Compiler// Project: World Analysis// Written by: kejie 03 computer science and techology 086// Create time: 2006.3.25// Modified: 2006.4.2// File name:

Total Pages: 64722 1 .... 56224 56225 56226 56227 56228 .... 64722 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.