// Nim game // There are n piles of stones. The two take at least one stone from the pile each time, no stone can be taken as lose // determine whether the first hand is win or lose # include # include # include using namespace STD; int main ()
Problem descriptionhere is a game for two players. The rule of the game is described below:● In the beginning of the game, there are a lot of piles of beads.● Players take turns to play. each turn, player choose a pile I and remove some (at least
Question: When two people go to a country with many islands, ask them to visit the largest islands in the same order. Analysis: DP, Lis, and LCs. There are two solutions for this question: LCs and Lis. LCS: sort the two persons separately. Find
Water question, just follow the picture after proving there is a monotonicity # Include # include # include # include using namespace STD; # define Sq (x) * (x )) const int maxn = 10005; const int maxm = 5005; int f [maxn] [maxm], s [maxn] [maxm]
In general, economics and operational research are different as follows:1. Different subjects. Economics belongs to social science, and operational research belongs to Engineering Science (Management Science ).2. Different concerns. Economics
I hate to hear the argument that economics is the question of optimizing resource allocation.Many people may fall into a misunderstanding that economics is the best guide for decision-making, but this is a misunderstanding.Economics is neither
1. Compile the preprocessing (GCC-e source. e) to generate the source. e file.# Define: macro definition, which defines a symbol and performs simple replacement during compilation and preprocessing.# If/# endif: judge whether the following
In the case of mod, (a * B/c) % mod cannot be obtained directly from/C. You need to find a number INV to make inv * C % mod = 1. (A * B/c) % mod = (a * B * INV) % MOD;
Nature: If the inverse element is that the product function has a * B = C, then
"Songshan fengchan station is 982 above sea level, with a northerly wind direction"Fox Rush knows that the next three seconds will determine the fate of the entire continent. He needs to make a decision immediately.There was a warm look of concern
Rebuilding roads
Time limit:1000 ms
Memory limit:30000 K
Total submissions:9105
Accepted:4122
DescriptionThe cows have reconstructed Farmer John's farm, with its n barns (1
Farmer John wants to know how much
Address: poj 2348
There are only three situations in each step: (assume a> = B)
1: A % B = 0 at this time, it is natural to be defeated.
2: A
3: A> 2 * B. At this time, it is a winning situation. Why? Because at this time, it can always be
Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1785
Problem description more than 30 participants in this training team. You are undoubtedly excellent. However, due to the limited number of participating places, you can only select
Dice
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/65536 K (Java/Others)Total submission (s): 440 accepted submission (s): 259
Problem descriptionthere are 2 special dices on the table. on each face of the dice, a distinct number was
HDU 5008 boring string Problem
Question Link
Idea: Construct a suffix array. the array of height can be used to pre-process the prefix and number of prefixes starting with each Lexicographic Order (in fact, to remove duplicate strings), and then
Longest Common substring is a classic problem. Its basic description is "given two strings, find the longest and the same substring between them (consecutive) ". For example, the following two strings S and T have the longest common substring
# Include # include # include # include # include using namespace STD; int main () {int n, m, I, a, B, cot; while (~ Scanf ("% d", & N, & M) {COT = 0; for (I = 0; I
HDU 1730 Northcott game (NIM game deformation)
Click Open Link
Undirected Euler's loop:
1. Graph connectivity
2. The degrees of all vertices are even
# Include # include # include # include # include using namespace STD; const int Mt = 2000; const int MS = 50; bool vis [MT + 5]; int G [MS]
Undirected Euler's loop:
1. Graph connectivity
2. The degrees of all vertices are even
Recursively traverse from a point to find the path.
# Include # include # include using namespace STD; const int maxcolor = 50; int N, G [maxcolor + 1]
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