This document describes a file directory output format in the console. For details, see.Code
The Code is as follows:
# Include # Include # Include # Include # Include # Include String > # Include # Include Using Namespace STD; /*
Given N points, calculate the shortest path of 1-n. The additional condition is that a point before the N points is the village, and B is the castle. With a pair of boots, Mario spends zero time in a certain distance (L) and has only K chances. In
What are you talking about Time Limit: 10000/5000 MS (Java/others) memory limit: 102400/204800 K (Java/Others)Total submission (s): 4050 accepted submission (s): 1171 Problem descriptionignatius is so lucky that he met a Martian yesterday. but he
In this case, you need to consider moving the hammer to the external part of the grid. Otherwise, WA will increase the number of rows and columns by 5 (maximum distance) at the same time ).
For details, seeCode:
# Include # Include # Include #
The above is taken from the definition in graph theory.
AlgorithmAll paths that have been taken are deleted during the running process, that is, all the edges that have not been walked are left on the way. According to the definition of the cut
For details, seeCode:
# Include # Include # Include # Include # Include # Include # Define INF 0x3f3f3f # Define Maxn 1000005 Using Namespace STD; /* Question: given n columns, I want to swing between these n columns until it reaches the
The last semester was really fast. I still remember that I spent my summer vacation at school to do my questions every day, followed by a provincial competition, followed by an internship for half a month. The soft exam took me a week, the C ++
Given a rectangle, some vertices in the rectangle are given with a persimmon tree. Then, you can ask how many persimmon trees can exist in a length-and-width rectangle.
Solution: because the data volume in this question is small, directly count the
Http://www.cnblogs.com/Lyush/archive/2012/03/23/2413160.html
Once upon a time, I also wrote this question. It was just followed by what state compression DP, which was over ms, and now it is finally 0 ms. this is a little different. First, the
It is known that a0 = 0, a1 = 1, an = 3 * an-1 + an-2 (n> = 2 ). obtain aaaan Mod (1e9 + 7) (that is, a [A [A [n]).
Solution: The program uses set + pair to find the loop section. The first cycle section is 222222224 long and does not know how much
Meaning: tell a day, push forward and backward for a certain number of days, and output the date after calculation.
Solution: One day of simulation, the number of digits of the date is different.
The Code is as follows:
# Include # include #
Big D questions
Given a matrix of N * n, place 1, 2, 3... N * n this N * n number, requires that the number of I rows and the number of I-1 columns must be the same. Ask the minimum difference between the value of the row where 1 is located and the
Not easy Series II
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)Total submission (s): 6513 accepted submission (s): 5140Problem description you are not easy to live, I am not easy to live, he is not easy to live.
Qixi Festival
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)Total submission (s): 12718 accepted submission (s): 3505Problem description on Qixi Day, the old moon came to the digital kingdom. He posted a notice on
Given a tree with N nodes, ask for the distance between simple paths between any two points, that is, the shortest path.
Solution: spfa: directly perform spfa for each pair of points. Tarjan: find the nearest common ancestor C between two vertices A
Given a series of digital tubes, these digital tubes are composed of 3x3 figures. The adjacent two digital tubes overlap each other. How many possibilities are there.
Solution: Keep the possible display results of each number (where it can be
Q: It's very bare. Do not make a mistake in the order of M and N.
The Code is as follows:
#include #include #include #include #include using namespace std;int N, M;const int INF = 0x3f3f3f3f;struct Edge { int v, c, next; }e[500];int idx, head[2
Given n vertices and M unidirectional edges, search for a loop in the graph so that all vertices and vertices on the path are divided by edges and the largest.
Solution: Set the point right to AI and the edge right to bi. When selecting a vertex, it
After reading the following article, I suddenly realized that I had to admire the subtlety of the solution.
Http://blog.csdn.net/wh2124335/article/details/8739097Question:
In the first quadrant, a number of rectangles are given (the vertex range
For a cyclic sequence with a length of 2 ^ N, N can be obtained from a certain position in sequence to generate 2 ^ N sequences, it is now required to output a minimum cyclic sequence that meets the requirements. What is the K number generated by
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