This topic indicates that two colors are used to color each vertex in the graph so that the adjacent vertex colors are different. If there is such a scheme, the output will be "bicoloring." Otherwise, the output will be "not bicoloring .". The data
(It's still quite strange, ICodeIf you re-write it, it's right. You didn't know what went wrong before, always wa)
The problem is the minimum tree structure without a fixed heel.
If there is no fixed root, a manual root is given!
Then, review
I have been busy with lab work during this time. I haven't written questions for a long time. I have some questions on the hdoj 11 page, and I have been refreshing these questions over the past few days, however, I feel that hdoj 2037 is a good
I haven't written and checked the set for a while. I wrote a mistake when I wrote the result!
The boss gave this question. I started to think that the boss gave a search question and analyzed it. The search can be done, but the search process is
It is typical to find the number of bridges in the undirected graph and Output
Code:
# Include # include # include # include using namespace STD; const int n = 110; int N, ANS, G [N] [N]; int dfs_clock, pre [N], low [N]; bool is [N] [N];
So easy!
# Include # include # include # include using namespace STD; const int n = 110; int n, m, ans; char G [N] [N]; int A [] = {0, 0, 1,-1, 1,-1,-1, 1 }; int B [] = {1,-1, 0, 0, 1,-1, 1,-1}; void DFS (INT X, int y) {G [x] [Y] = '*'; For
I haven't done any questions for two days. There are so many things to do during the Chinese New Year. Today, I have to do one question anyway.
This question is the shortest path of a single source node. When I first thought of
The number of vertices is not the largest number, but the number of actual vertices in the input.
More simple than Floyd questions
Code:
# Include # include # include using namespace STD; const int n = 110; const int INF = 100000000; int
# Include # include # include # define max 20 using namespace STD; struct edge {int U, V, W;} edges [Max]; int parent [Max]; int n, m; int I, j; void ufset () {for (I = 1; I = 0; S = parent [s]); While (s! = X) {int TMP = parent [X]; parent [x] =
I recently studied Unix programming and looked at small games written by others.CodeSo I learned the signal () function.
Signal (sigwinch, (void (*) (INT) handle_signal );
The above line is a little game.Source code
First ParameterNumber
Question: For a graph, there are three source points. The condition that each point is traversed is that this point is connected to three already traversed points! At the beginning, three vertices have already been traversed. Ask the time when each
This question falls in three places:
First, the number of times that the outermost cycle of dij is ignored should be the number of nodes that appear, rather than 26;
The second is to ignore the case where the divisor is 0;
Third, it is the
// There is no such thing as the Queen of eight. # include # include # include int map [10] [10]; int sum, Max, C [20000]; void DFS (INT cur) {int I, j, OK; if (cur = 8) {sum = 0; for (I = 0; I MAX) max = sum;} else for (I = 0; I
A very important piece of information about this question is that the lattice that has passed through cannot go any longer, so I think it is enough to backtrack and pruning.
Pruning is necessary, because each grid has four choices. The worst case
The bare question of finding the Minimum Spanning Tree is that the data is large and must be stored in an adjacent table.
Code:
#include #include #include using namespace std;const int N = 200010;const long long INF = 10000000000;int n, m, id, head[
/* At the beginning, TLE later found that the recursive function would not time out when it was pushed to the previous layer at. Okay... */# Include # include # include int sign [100] [10]; int flag; void print (int * a, int * P, int cur) {int I,
Question Link
Question:A sequence composed of n positive integers. Given an integer S, this is a continuous sequence with the shortest length so that their sum is greater than or equal to S.
There are multiple solutions to this question. If we
General questions;
The minimum cost is the maximum flow. If it is an undirected graph, it must be done using an adjacent table.
Code:
// The maximum flow with minimum cost. Note that the edge of the graph is bidirectional. # include # include #
There are several rooms, starting from one room. The light is on and the two rooms are connected. The question will show the control switch of the room, that is, the switch of the room that can be controlled. Enter the number of rooms, the number of
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