/* Simple enumeration */# include # include using namespace STD; int A [4] [2]; int main () {int N; while (scanf ("% d", & N) {for (INT I = 0; I 0) num2 ++; else tag = 1 ;} if (num1 = num2 &&! Tag) {printf ("% d \ n", I, j); flag = 1;} If (FLAG)
Go directlyCode, Click here for more information.
# Include # include # define PI 3.141582626535 # define e 2.718281828459 using namespace STD; int main () {int n, m; CIN >>> N; while (n --) {CIN> m; int ans; ans = int (M * log10 (M/E) + log10 (2
Analysis:Because this question only gives two colors, we can use BFS as an opportunistic method to determine that the level of two knots in wood is the same. But it seems like this is the case.Four color map theorem,Therefore, four colors can be
/* Poj 2677 tourdp dual-tuned Euclidean Traveling Salesman Problem transfer equation: When J = I-1: d [I] [I-1] = min {d [I-1] [k] + P [I] [k]} (1 # include # include # define min (, b) (a
The question is very simple, the data is not big, and you can directly search for it.
# Include # include # define maxn 105int map [maxn] [maxn]; int n, m; void DFS (int I, Int J) {If (! Map [I] [J]) return; Map [I] [J] = 0; DFS (I + 1, J);
/* A little bit of information, data is a bit problematic. The question ends with n = 0 and m = 0. However, the test data should be n = 0, M! = 0 ends, orz, WA multiple times */# include # include using namespace STD; const int maxn = 105; int G
/* The describe is not clear */# include # include using namespace STD; const int maxn = 205; int degree [maxn]; int f [maxn]; int N, R; int find (int x) {If (X! = F [x]) {f [x] = find (F [x]);} return f [X];} int main () {While (scanf ("% d", & N,
Oil Deposits
Time Limit:1000 MS
Memory Limit:10000 K
Total Submissions:11077
Accepted:5991
DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. geoSurvComp
Template question. You can use kruskal or the shortest path.
# Include # include # include # include using namespace std; const int maxn = 5555; int u [maxn], v [maxn], p [maxn]; double map [105] [2]; struct node {int id; double w;} r [maxn];
Window Pains
Time Limit: 2 Seconds Memory Limit: 65536 KB
Boudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he usually runs nine applications, each in
Problem EConnect the CampusInput:Standard inputOutput:Standard outputTime Limit:2 seconds
Creating new buildings are under construction on the campus of the University of Waterloo. The university has hired bricklayers, electricians, plumbers, and a
Popular Cows
Time Limit:2000 MS
Memory Limit:65536 K
Total Submissions:19089
Accepted:7678
DescriptionEvery cow's dream is to become the most popular cow
For a given m * n Board, there are three ways to place the black and white queen. Rows, columns, and diagonal lines.
Row:Select a queen to place one queen in m * n mode, and then place another queen in (n-1) mode.N * m *
Analysis: This question is very interesting. Although it is very simple, you can use it as a trainer to train your own code capabilities.
Note: When a and B are equal, it is determined that the input is invalid and no operation is
Question:Your initial blood volume is 100. The blood volume in each room may be negative and may be positive. If your blood volume is not greater than 0 or you cannot run to the last room, you will lose. Otherwise, you will win.
Analysis:Each room
It is to first build two trees and then traverse these two trees. I would like to call this type of tree a quad-tree. What makes it difficult for me is to build a recursive structure, and then to get more ideas during traversal. For more information,
The question is a three-dimensional image, so open a three-dimensional array, and then use bfs to OK!
The following code is used:
#include#include#includeusing namespace std;#define MAXN 31struct node{ int l; int r; int c; int t;
/* Determine whether there is an Euler loop or the old one: first judge whether the graph is connected. This question is an undirected graph, and then judge the degree of each vertex, last printed */# include # include using namespace std; const
B. Hometasktime limit per test
2 secondsMemory limit per test
256 megabytesInput
Standard inputOutput
Standard output
Furik loves math lessons very much, so he doesn't attend them, unlike Rubik. but now Furik wants to get a good mark for math. for
/* A lawn with a length of l and w can be installed in n positions on its horizontal center, the coverage range of the sprinkler in each position is the circle with their own radius ri. Find the minimum number of sprinkler devices required. Map it
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