HDU 1066 last non-zero digit in n! [Factorial]

Ye found the wrong one during the game.Code: # Include # include #include using namespace STD; # define maxn 10000 const int mod [20] =, 8, 6, 8, 2}; // list the last int LD (char * BUF) {int Len = strlen (BUF), a [maxn], I, c, ret = 1; if (LEN

Hdu2433 BFS + Optimization

Travel Time Limit: 10000/2000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 1120 accepted submission (s): 381 Problem description one day, Tom traveled to a country named BGM. BGM is a small country, but there are

[Poj 1611] the suspects [query set templates] [recursive and non-recursive implementations]

/* Model one * // 364k47ms [recursion on poj is a little faster ~] # Include # include using namespace STD; const int maxsize = 30005; int parent [maxsize]; // root node storage-num (number of nodes in the tree ), sub-nodes store parent node int

Poj 2524 ubiquitous religions

The general meaning of the question is that many students have different beliefs, and there is a connection between them. Ask them how many beliefs they have... Is a simple query set, and the number of root nodes .... Directly go to the Code,

Poj 3070 Fibonacci [matrix concatenation]

Fibonacci Time limit:1000 ms   Memory limit:65536 K Total submissions:6881   Accepted:4873 Description In the Fibonacci integer sequence,F0 = 0,F1 = 1, andFN=FN− 1 +FN−2N≥2. For example, the first ten termsThe

HDU 4027 line segment tree

Can you answer these queries? Time Limit: 4000/2000 MS (Java/others) memory limit: 65768/65768 K (Java/Others)Total submission (s): 6849 accepted submission (s): 1566Problem descriptiona lot of battleships of edevil are arranged in a line before the

HDU 3397 line segment tree + interval merge + lazy question marking

Sequence operation Time Limit: 10000/5000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 4603 accepted submission (s): 1338Problem descriptionlxhgww got a sequence contains n characters which are all '0's or '1' S.We

Blue Bridge exercises

5 clockwise spiral count: #include#includeint map[25][25];int main(){ int n; while(scanf("%d", &n) != EOF) { memset(map, 0, sizeof(25)); int temp = 1; int x , y; int up = 1, down = n; int left = 1, right =

HDU 1677 nested dolls [greedy solution to nested dolls]

Link: http://acm.hdu.edu.cn/showproblem.php? PID = 1677 http://acm.hust.edu.cn/vjudge/contest/view.action? Cid = 28195 # Problem/E Nested dollsTime Limit: 3000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (

Poj 3083 children of the candy corn

A simulation + BFS can be used for water, but the amount of code is a little too large, and it is full of tears. Due to the BFS mark error, I re ten times! (BFS should be marked every time you join the team !! Remember it !!!) Later, I wrote a

Merge Sorting and quick sorting comparison [Algorithm Design and Analysis Experiment Report]

The source code below is the Modified Time Difference Accurate to the nanosecond level, but it still feels very error. No matter how you test the data, it is always faster than merging, even if the length of the test data array is less than 10. The

Poj 3624 charm bracelet [Think About Bare 01 backpack and greedy solution 01 backpack]

Original question link: http://poj.org/problem? Id = 3624 My link: http://acm.hust.edu.cn/vjudge/contest/view.action? Cid = 20437 # Problem/a welcome water Charm bracelet Time limit:1000 ms   Memory limit:65536 K Total

HDU 1317 xy1_[ bellheman_ford judgment positive ring small application]

Link: http://acm.hdu.edu.cn/showproblem.php? PID = 1317 http://acm.hust.edu.cn/vjudge/contest/view.action? Cid = 29015 # Problem/fxy.pdf Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)Total submission (s): 1701

[HDU 1548] A strange lift [Dijkstra shortest path]

Question: The elevator can only go up or down to step Ki on layer I and ask how many steps are required from layer a to layer B. Ideas: Returns the shortest path of a directed graph. Dijkstra is the positive weight. Note: The vector needs to be

Poj 3026 Borg maze

In the eyes of many great gods, This is a water problem, but cainiao cannot afford to hurt, and it is not easy to understand English, and it is found that the BFS written for one day yesterday has been relentlessly wrong. ah, it's Valentine's Day

[Hdu1017] exact cover [DLX] [dancing links] [annotation Routine learning method]

Dancing links solves the exact cover problem. The circular bidirectional cross linked list is used. DFS. I read this article, found an AC source code, and used the annotation method to help me understand it. Hit ACM Thanks to the source code Po

[Hoj 2255] Not Fibonacci [matrix fast power]

# Include #include #include # define mod 10000000 using namespace STD; typedef long ll; ll a [4] [4], TMP [4] [4], ANS [4] [4]; // 0.00 s 1260 K/** construct the initial vector of the matrix column vector A [4] [4] = {0, 0, 0}, {0, P, Q, 0 }, F (n)

[Poj 1742] Two solutions for coins multi-backpack Optimization

Use a regular Multi-backpack to meet TLE. The optimization is as follows: // This question is mainly because cost and weight are the same, and only ask whether the number can be included. // set the DP array to bool type. If it can be reached, it

Weak School ACM struggle history

The original author has no idea who the teacher is, but this is my favorite ACM article. I copied it on the rise of today ~~~~~~ This is the best article I have ever written. Reprint source (not original):

[Dp_basic] [LCS] common sequence

/* This code is submitted by IRIS for problem 1227 at 10:41:29 * // hoj 1227 common subsequence/dp [I] [J] represents first I elems and first J elems' s LCS # include # include # include using namespace STD; int max (int A, int B) {return (A> B )?

Total Pages: 64722 1 .... 28589 28590 28591 28592 28593 .... 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.