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
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
/* 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
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,
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
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
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
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 =
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
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
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
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
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
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
# 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)
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
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):
/* 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 )?
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