--------------------------The barrel is not enough, I have no way ...1 ImportJava.io.BufferedReader;2 Importjava.io.IOException;3 ImportJava.io.InputStreamReader;4 5 Public classmain{6 7 Public Static voidMain (string[] args)throwsNumberFormatException, IOException {8 9BufferedReader reader=NewBufferedReader (NewInputStreamReader (system.in));Ten One intn=Integer.parseint (Reader.readline ()); A intbook[]=New int[151]; -String Ss[]=reader.readline (). Split
Topic transfer: Human Gene FunctionsIdea: The deformation of the LCS, defining the state dp[I [j] is the maximum value obtained for the first J characters of the string s before I character string T, then we can get the state transition equation as:dp[I [j] = max (dp[I [j-1] + f['-'] [t[j]], dp[i-1 [j] + f[s [i] ['-'], dp[i-1][j-1] + F [s [i]] [t [j]]);AC Code:#include Poj-1080-human Gene Functions (variant of LCS)
A classic 2D DP problem. A disguise of LCS-actually not very hard to decode: it is about 2 sequences 'matching, though with a weight value of each match.
The point of this problem: how to decode Problem Statement and how to distill the actuall model behind. coding is not very hard, but my 80% debug time is spent on a stupid detail: In the 2 level for loop, indices start from 1, but Char index of each string shoshould be I-1, J-1.
Main reference: http://blog.csdn.net/xiaoxiaoluo/article/details/7
1080 line tree exercisesTime limit: 1 s space limit: 128000 KB title level: Diamonds Diamond Title DescriptionDescriptionA row of n squares, beginning with an integer in each lattice. Some questions and modifications are presented dynamically: the form of questioning is the summation of all elements in a particular sub-interval [a, b]; the modified rule is to specify a lattice x, plus or minus a specific value, a. You are now asked to make the right a
following modifications to the Libcaffe propertyIf there is a problem with OpenCV during compilation, double-click the Error statement to comment out the part about OpenCV, and regenerate Libcaffe should be possible.This should compile successfully, and finally click Build-Build solution should be able to build successfully.When this file appears, it shows success.6. Test whether MATLAB and Python are available caffeAdd Matcaffe from the Caffe file directory to the path of MATLABCaffe-master\ca
Question Link
Question:
There is a string that contains only 0 and 1, and then the M group operation, I L R is to flip from L to R 0 to 1, 1 to 0, q X indicates the X character.
Ideas:
We only need to calculate how many times the query character has been flipped over. If it is an even number of times, this character is changed; otherwise, it is flipped over. We can use the line segment tree for Interval Update. However, for this question, it is only a point query, and each node has the same init
This topic describes typical dynamic planning. It is critical to identify three different cases of sequence comparison, that is, subproblems.
Set d [I] [J] to take the maximum score of the S1 I character and S2 J character
When P is the best, three P arrays are used as the score matrix.
1. S1 take the I letter, S2 take "-": d [I-1] [J] + P [S1 [I-1] ['-'];
2. S1 take "-", S2 take the J letter: d [I] [J-1] + P ['-'] [S2 [J-1];
3. S1 take the I letter, S2 take the J letter: d [I-1] [J-1] + P [S1 [
: At the beginning, let's look at the reasons for mistakes made by others in discuss: matrix CC error, DP equation error, array write error ..... right one by one. After reading it twice from start to end, I found that the initial DP condition was wrong. In this way, it would be too difficult to pass the example !! It seems that the robustness of self-built Edge Data Testing programs will be enhanced in the future !!
[BTW] it seems that the formal problem-solving report starts from this articl
its performance upgrade email hope, but the reality tells you: it is only GT 840M "identical twin brother" only, so if you hold to buy it than to buy GT 840M a better attitude to look at this article, disappointment is fully understandable.But in other words, is the GT 940M really weak? The answer is no, it does not match the performance of the GTX, because this is not its mission, the 1366x768 resolution is the world of its, at this resolution, the GT 940M can play its due level, for online ga
Topic: Segment tree interval change and query, but involves two kinds of interval modification, one is to give the number of the interval of all plus one number, and the other is to set an interval to the same number, and then ask the entire interval and.Problem Analysis: Handle the Set operation and add operation sequence is OK.The code is as follows:# include hihocoder#1080 (segment tree)
;Exception admission for output and rankingint kongge=0;Control the output of a spaceForint j=0; Jif (Stu[j]. r==0 stu[j].prefer[i]==1 (want[i]>0 | | want[i]==0 stu[j].rank==top)) //the student was not admitted, the student to apply for the school, the school is still hiring, or the school is full, only the students to tie this position {if (kongge!= 0) printf ( " "%d", Stu[j]. ID); Kongge=1; top=stu[j].rank; //records the candidate's ranking Stu[j]. R=1; //mark candidates have dropped files
each gene sequence is at least one and does not exceed 100.OutputThe output shocould print the similarity of each test case, one per line.Sample Input2 7 AGTGATG 5 GTTAG 7 AGCTATT 9 AGCTTTAAASample Output14 21Evaluate the maximum weight of two string matches. dp [I] [j] indicates the maximum value of the two strings that are I and j respectively.Each character can be matched with or without spaces,Dp [I] [j] = max (dp [i-1] [j-1] + v [I] [j], dp [i-1] [j] + v [I] [kong], dp [I] [j-1] + v [kong]
Linked List optimization search
/** Tyvj-1080 * Mike-W * 2012-2-3 * ================== * use something like DLX * it's double link list. .. */# include
Title Description:
Converts the number of M-binary x to the number output of n-binary.
Input:
The first line of input consists of two integers: M and N (2The following line enters a number x,x is the number of M-binary, and now requires you to convert the M-binary number x to the N-binary number output.
Output:
The number of the N-binary representation of the output x.
Sampl
Aurora IM How to use, now let me teach you step-by-piece self- control IM Application . STEP 1: Sign up for the developer account and log in to Aurora Portal. (Aurora im) with the Aurora developer account, you can Create and manage apps on the Aurora Portal. 650) this.wi
Application Status of mobile Internet
Because the mobile phone platform itself, electricity, network traffic restrictions, mobile Internet applications in the design with the traditional PC application is very different, according to the characteristics of the mobile phone itself, as far as possible to save power and flow, but also to ensure that the data can reach the client in time.
In order to solve the problem of data synchronization, there are 2 kinds of methods used in mobile phone platfo
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.