Introduction
Our group came to a beautiful programmer, I secretly happy, haha this next opportunity to come. I'm trying to figure out how to do it. OK, or from the QQ number, to find the goddess to qq number, haha, I am really a genius ~ ~ ~
It's like this.
The idea is beautiful, the reality is cruel, to find the godde
To find the goddess QQ number
Introduction
Our group came to a beautiful programmer, I secretly happy, haha this next opportunity to come. I'm trying to figure out how to do it. OK, or from the QQ number, to find the goddess to qq number, haha, I am really a genius ~ ~ ~
It
Rough gave the analysis, recently tired, will be improved later. The topic includes three small questions, from simple to complex: 1, if only one appears once, to investigate the nature of the XOR, is if the same number and their own or the result of the work is zero, then loop through the array, the elements in the array to do all the different or operation, then two times the number is all different or dr
A+b AgainAccepted:15 submit:243Time limit:1000 MS Memory limit:65536 KBTitle DescriptionLast fun Sai Xiaoming a+b pit A lot of students do not like to think, Xiao Ming in order to apologize, this time out a simple a+b to everyone when check-in questions, I hope we can be happy brush questions. So, the problem comes!!!The value of the smallest positive integer x that makes B/(a+x) an integer.InputThe first line is an integer K (k≤10000) that represents the nu
Problem:
There are many unordered numbers, from which we can find the maximum number of K. Assume they are not equal.
Solution 1:
If there are not many pieces of data, for example, a few thousands or so, we can sort the order to find the maximum K number. You can select quick or heap sorting for sorting.
# Include
S
] = A [0];
B [0] [1] = 1;
Int t = 0;
Bool notExist = true;
For (int I = 1; I
{
For (int j = 0; j
{
If (A [I] = B [j] [0])
{
B [j] [1] ++;
NotExist = false;
Break;
}
}
If (notExist)
{
B [t ++] [0] = A [I];
}
}
Int max = 1;
Int k = 0;
For (int I = 0; I
{
If (B [I] [1]> max)
{
Max = B [I] [1];
K = I;
}
}
TheOne = B [k] [0];
}
Method 2Sort the array. The number in the middle is the number you are looking.If
' (x0) (x-x0), and obtain the X coordinate X1 = x0-f (x0) of the intersection of L and the X axis) /F' (x0), that is, X1 is an approximate value of R.
Through point (x1, F (X1) to do the curve y = f (x) tangent, and find the X coordinate X2 = x1-f (X1) /F' (X1), called X2 is the quadratic approximation of R. Repeat the above process to obtain the Approximate sequence of R, where x (n + 1) = x (n)-f (x (n)/F' (x (n )), n + 1 approximation of R. The abo
Problem:An ordered array, the value may have negative values, or there may not be, you need to find out the absolute value of the least.Method 1:Iterate through the array, find the absolute value minimum, the time complexity O (n), and N is the number of elements.Method 2:Binary lookup, because the array is ordered, can be used to
Find out which process is consuming commands for a port number1) Use the lsof commandLsof is a very powerful Linux tool that she is used to find out which programs use those files. Under the Linux system, basically everything can be used as a file. The socket is, of course, a file. So lsof can be used to find out who used a certain port. Specific methods:lsof-i:p
Describe:
Title DescriptionPlease find the longest consecutive number string in the string, and return the length of the string, and if there is a continuous number string with the same length, the last consecutive number string is returned;Note: The number string only n
1. In the R language, how to find the number that satisfies the condition?For example, given a vector c2. Required to find numbers greater than 0:> C2[1] 0.00 0.00 0.00 0.00 0.00 0.00 0.06 0.09 0.20 0.09 0.08 0.14 0.14 0.23[15] 0.08 0.06 0.12 0.20 0.14 0.11 0.20 0.14 0.17 0.15 0.18 0.15 0.20 0.12[29] 0.23 0.08 0.12 0.08 0.23 0.12 0.08 0.17 0.18 0.17 0.12 0.17 0.1
(Hdu step 2.1.6) find new friends (simple use of the Euler's function: calculate the number of elements that are mutually compatible with n), hdu2.1.6
Question:
Find new friends
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission (s): 2788 Accepted Submission (s): 1307
Pr
Hdu1029:ignatius and the Princess IVKuangbin Topic 12 Basic DP:B problemTime limit:2000/1000 MS (java/others) Memory limit:65536/32767 K (java/others)Total submission (s): 35107 Accepted Submission (s): 15340Problem Description "OK, you aren't too bad, em ... But can never pass the next test. "Feng5166 says."I'll tell you a odd number N, and then N integers. There'll be a special integer among them and you've to tell me which an integer is the Special
This also lets us find the number of duplicates in the array, but gives a lot of restrictions. In fact, Leetcode seems to some restrictions on conditions, can not make judgments, we are still strict requirements of the good OH.
First of all, the first one can not change the array, in fact, this is to limit our sort, if the sort, and then iterate again quickly can find
DescriptionSevere Acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, were recognized as a global threat in Mid-March 2003. To minimize transmission to others, the best strategy are to separate the suspects from others.In the Not-spreading-your-sickness University (NSYSU), there is many student groups. The Students in the same group Intercommunicate with each other frequently, and a student may join several groups. To prevent the possible transmissions of SARS, the NSY
I can only say good dragon Boat Festival you do not date? , still writing code here? I am also bored enough, not to go off work is also in the follow-up writing to play! "Looking for girls to QQ number original" original link http://www.cnblogs.com/iforever/p/4584490.htmlTitle: give a bunch of numbers (631758924 is not QQ number), according to the following rules can fi
Find out the number of isomorphic numbers between 1 and N. A homogeneous number is a group of numbers: it appears to the right of the square number. For example: 5 is the number to the right of 25, 25 is 625 to the right, and 5 and 25 are isomorphic numbers.
Detailed De
1. The easiest way to thinkWe can use the simplest way to find an array of arbitrary size of the number, that is, according to a sort of array of all the elements of the order, and then as needed to remove it, the knowledge of this way of time complexity and space complexity is relatively large, so, with the following way2. By setting two variables to make a judgmentThis way you can
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.