Topic Portal1 /*2 Test instructions: One rabbit jumps clockwise, the other jumps counterclockwise, and the weight of the stones is equal and cannot cross the starting point .3 LPs: This is the application of LPs, the ring multiplied into a chain, a set of LPS, but do not understand dp[i][i+n-2] + 1, see other people's problem-solving report, to later fill (play t
1. Non-retention Ram/register:If the use of Ram/register itself in the Power-down state can not save its own state, then make sure that they will be in the power-up when the reset.2. Output signal of Power-down part circuit in chip:Power-down some of the output signals of the circuit can be used by other power-on parts of the circuit, then these signals must be processed. Avoid the X-value transmission to the power-on part of the circuit.There are three kinds of processing methods: latch (the va
Question: poj 2484 cow Exhibition
Question: Give the nheaded ox. Each ox has a lucky Si and a smart ti. Now we need to select some cows to maximize the sum of the two values, provided that sum (SI) and sum (Ti) are both non-negative values.
Analysis: The data volume of this question is small, and it can be searched and trimmed.
Here we will talk about the idea of a 0-1 backpack. The obvious deformation of this question is that the item has two attri
Question LinkMeaning: There are n coins in a circle, and two people take turns to take one or more adjacent coins each time (only the first and last adjacent coins are counted ), ask if the first hand wins or loses.
This question proves thatN> = 3, The first hand will be defeated.Symmetric gameIfN> = 3For the first time, the first hand must split the ring into a chain. No matter the parity of the chain length, the latter hand can always divide the chain into two equal chains, so what does the
DescriptionAlice and Bob decide to play a funny game. At the beginning of the game they pick N (1
Figure 1
Note: For n > 3, we use C1, c2, ..., cn to denote the coins clockwise and if Alice remove C2, then C1 and C3 is not adjace Nt! (Because there is a empty place between C1 and C3.)Suppose that both Alice and Bob does their best in the game.You is to write a program to determine who'll finally win the game.InputThere is several test cases. The which contains a positive integer n
Topic Link: Click to open the linkTest instructions: N number of numbers 1-n around a ring, two people take turns, each time can only take the adjacent two or only one, can not take the loser.Consider such a problem, if it is not a ring but a line, that is, from the 1-n into a row, so that the initiator just take the middle of the two or a composition of the number of equal (left and right symmetry), then the initiator can be invincible (simply speaking, regardless of which side the opponent tak
POJ 2484 A Funny Game (IQ Game), poj2484
Time Limit:1000 MS
Memory Limit:65536 K
Total Submissions:6397
Accepted:3978
DescriptionAlice and Bob decide to play a funny game. at the beginning of the game they pick n (1
Figure 1
Note: For n> 3, we use c1, c2,..., cn to denote the coins clockwise and if Alice remove c2, then c1 and c3 are NOT adjacent! (Because there is an empty place between c1 and c3 .)
Suppos
SDUTOJ 2484 arithmetic expression conversion (stack)
Arithmetic expression Conversion
Time Limit: 1000 MS Memory limit: 65536 K
After learning the data structure, James suddenly remembered the problem of converting an unsolved arithmetic expression into a suffix. Today he wants to solve it. With the data structure, James quickly solved this problem, but he suddenly thought about how to find the prefix and mid-fix expressions of arithmetic expre
POJ 2484-A Funny Game (symmetric Game)
Question link: Click the open link
Question: n numbers are numbered 1-n in a ring. Two people take turns and can only take two adjacent rings or only one ring at a time.
Consider such a problem. If it is not a ring but a line, that is, from 1-N to a line, the first hand can take two or one of the middle to form equal numbers (symmetric between left and right ), then the first hand will be able to stand undefeated
A Funny Game
Time Limit: 1000MS
Memory Limit: 65536K
Total submissions: 5099
accepted: 3180
Description Alice and Bob decide to play a funny game. At the beginning of the game they pick N (1
Laszlo development is divided into two branches:
Endotoxin 2.2It is the main branch, with priority to stability and bug fixing. This is the direction of commercial recommendation, and this version does not support 3.0 features.
Endotoxin 3.0Is a branch of the development version. The main feature of LPS 3.0 is that it does not depend on the server deployment mode, supports Unicode, integrates browsers, and adjusts the application size and speed. A
Problem:
The longest palindrome subsequence of the given input string (the subsequence does not require continuous).
LPs (I,J) is used to denote the length of the longest palindrome sequence from the string I character to the J character, the length of the string is N, and LPs (1,n) is required:
LPS (I,J) = 0; i>j;
Given a string S, find the longest palindromic substring in s. The maximum length of S is assume, and there exists one unique longest palindromic substring.The longest palindrome, for each character from the middle to the sides of the search, attention to the odd and even two kinds of cases. The total time complexity is O (n^2). In addition Manacher algorithm complexity is O (n), the manacher algorithm is very complex appearance, IQ catch urgent, have to digest a bit. Put on a simple one first.1
/**/classpublicstaticint Maxlengthpalindrome (int//}Solution One:Implemtation is recursive, and it ' s much worse than O (n^2). Should use recursive with memorization and then can improve to O (n^2).However, recursive memorization doesn ' t improve over bottom-up and it had costly overhead. Bottom-up is better in this problem. Public classSolution { Public Static voidMain (string[] args) {intArr[] =New int[] {4,1,2,3,4,5,6,5,4,3,4,4,4,4,4,4,4}; System.out.println (arr, maxlengthpalindrome0, Arr.
\ ZendOptimizer. MemoryBase @ SYSTEM: [3] The SYSTEM cannot find the specified path.[2748] Unable to write base address: [3] The system cannot find the specified path.[2484] D: \ Program Files \ VertrigoServ \ Apache \ % SYSTE ~ 1 \ TEMP \ ZendOptimizer. MemoryBase @ SYSTEM: [3] The SYSTEM cannot find the specified path.[2484] Unable to open base address file: [3] The system cannot find the specified path.
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.