To improve Software maintainability, the following principles should be followed:1. "Open-Close" principle (OCP)A software entity should be open to extensions and closed to modifications.2. Lishi replacement principle (LSP)Child types must be able
C # Use the delegate model to implement events. The event processing method does not need to be defined in the generated event class. What you need to do is to combine the event source with the event processing program, the event processing delegate,
Last week, BEN of the algorithm class spent an hour talking about the relationship between automatic machines and KMP... I have to go to class again tomorrow. I spent half a day reading KMP, and now I am stuck in the skip length in the next mode. I
It is also a minimal spanning tree problem.
Special Judge. The answer is not unique. So the sample looks wrong...
It is also a sad G ++ AC. Submit C ++ and then WA...
We have to go over the road and look at it.
# Include
# Include
#
Question link: http://poj.org/problem? Id = 3922
Http://acm.hdu.edu.cn/showproblem.php? Pid = 1, 2486
This is hard to understand. Record it first.
Raytheon question: http://www.cnblogs.com/jianglangcaijin/archive/2012/12/19/2825539.html
Paste a
Ultraviolet A 11768-Lattice Point or Not
Question Link
Given two vertices to form a line segment, these points are in the form of a very bit, and the positive number points fall on this line.
Train of Thought: first form a x + B y = c for the linear
Connection: Ultraviolet A 10622-Perfect P-th Powers
For x, if the maximum p exists so that the integer must be x = bp, x is called perfect pth power. Returns x and returns p.
Solution: use x to break down the prime factor. The maximum number of all
The questions are as follows:
Problem D: xy.pdf
ADVENT: /ad?vent/, n.
The prototypical computer adventure game, first designed by Will Crowther on the PDP-10 in the mid-1970s as an attempt at computer-refereed fantasy gaming, and expanded into a
Bone Collector IITime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission (s): 2089 Accepted Submission (s): 1097Problem DescriptionThe title of this problem is familiar, isn' t it? Yeah, if you had took part
(1) incremental Constructor
# Include
# Include using namespace std; const int MAXN = 1000; int A [MAXN], n; void print_subset (int n, int * A, int cur) {for (int I = 0; I n; print_subset (n, A, 0); return 0 ;}
(2) bit vector method
#
It seems that this algorithm is quite limited. Repeated search is a bad place and requires efficient Valuation Functions for strong pruning, which is difficult.
Iterative search depth is a cool search method, but it is a bit time-changing.
The first
766-Sum of powersQuestion: Find the coefficient of conversionIdea: after reading the nature of bernuoli number in wiki, we can push it.Then B is the bernuoli number, with a formula,In this way, we can calculate the bernuoli number for each item by
Question:
Evaluate the number of different substrings in a string.
Train of Thought Analysis:
A substring must be the prefix of a suffix.
Therefore, we take out each suffix, analyze how many prefixes it has, and then remove the same prefix as the
Link to the question: Ultraviolet A 11426-GCD-Extreme
Question: Give n, ask Σ I! = Jngcd (I, j)
Solution: f (n) = gcd (1, n) + gcd (2, n) +? + Gcd (n? 1, n)S (n) = f (2) + f (3) +? + F (n)S (n) = S (n? 1) + f (n)The problem is converted to how to
[BZOJ2709] Two-point addition verification of water. However, it seems that the reading fails...
[BZOJ3229] see this for powerful algorithms. It was "recommended" by a bunch of experts in the IDC room, so it was pitted... Written for one afternoon...
Ultraviolet A 1434-YAPTCHA
Question Link
Question: Find the answer to the formula in the question
Ideas:When 3?K+ 7 when it is not a prime number, then (3?K+ 6 )! (Because we can certainly find two factors to multiply)Therefore, the original
1069-Always an integerGiven a polynomial, determine whether it is always an integer.Idea: the example in the LRJ White Paper shows that as long as the equation 1 to k + 1 (k is the maximum number of times) is an integer, then the entire equation is
Link to the question: Ultraviolet A 1069-Always an integer
Returns a polynomial multiple times and asks if the structure is an integer for any positive integer n.
Solution: First process the string, and then enumerate n from 1 to k + 1 to judge. k
Question:
Returns the maximum length of a substring that can be overwritten for k times.
Train of Thought Analysis:
It is also the length of the binary answer, and then scan the height to determine whether the result is true.
#include
Ultraviolet A 1436-Counting heaps
Question Link
Given the structure of a tree, place 1-N numbers in it. The value of the parent node must be smaller than that of the child node.
Train of Thought: f [u] indicates the case where u is the subtree, then
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