Question Link
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1201
This question was submitted many times during the competition, all of which were wa. The main mistake was that I did not consider the last year, the next year, that is, if the year Y + 18 is a leap year and the month m> = 3 | (M = 2 D = 29)
The number of days is one more day.
Divided into three parts: Y + 1-> Y + 17 y + 18
Wa code
# Include Int main (void){Int kk (int n );Int T;Int y,
// This program mainly describes the two simple methods for getting different elements from the two arrays.
// One
Public class test {
/**
* @ Param ARGs
*/
Public static void main (string [] ARGs ){
String [] KK = {"C", "B", ""};
String [] HH = {"A", "B "};
String STR = "";
For (Int J = 0; j
STR + = HH [J];
}
For (INT I = 0; I
If (Str. indexof (kk [I]) =-1 ){
System. Out. pri
C # version
/***** Distance from a point to a straight line ***
* The Linear Equations of points (x1, Y1) and points (X2, Y2) are: Kx-y + (x2y1-x1y2)/(x2-x1) = 0* Set the straight line slope to k = (y2-y1)/(x2-x1), c = (x2y1-x1y2)/(x2-x1)* The distance from point P (x0, y0) to the straight line AX + by + c = 0de is: D = | ax0 + by0 + c |/SQRT (A * A + B * B)* The shortest distance from a vertex (X3, Y3) to a straight line between a vertex (x1, Y1) and a vertex (X2, Y2) is:* Distance = | K * X3-Y
I. The basic idea of high-precision multiplication is the same as that of addition. The basic process is as follows:
① Read the multiplier S1 and S2② Divide S1 and S2 into four segments and convert them into values that exist in arrays A and B. Write down the lengths of A and B, K1 and K2;③ I is assigned the bitwise in B;④ Obtain the multiplication of the I-th and A from B and accumulate it into the C of another array. (Note: The number of wrong digits should be?)⑤ I: = I-1; Detection I valu
In mid-December, I had an in-depth dialogue with the Internet prophet, former editor of Wired magazine, and Kevin Kelly (KK), author of Runaway. In the process of dialogue, KK says AI is the technology that is going to be a big line over the next 20 years, but AI will not replace humans. KK said that humans are destroyed by robots is a very typical Hollywood scen
The following code is written because the project uses Aurora push to broadcast the amount that the user consumes.Premise 1: Broadcast audioPremise 2: Aurora pushResolution 1: The Chinese amount is broadcastProblem Solving 2:10100 trillion and zero broadcastIf there is a better way please leave a message, we learn from each other ha!On the code:Private Function Duqu ($total _fee = 0) {if (Empty ($total _fee)) return false;Set 0十百千万亿$array = Array (' 0 ' = ' 0 ', ' 1 ' = ' + ', ' 2 ' = ' + ', ' 3
For Example:
1. Create a connection to a file
[Root@a ~]# ln-s/home/kk/ss.sh ~ #如果不写目标地址, that is, in the current directory built link
[Root@a ~]# ls
Centos-base.repo.oldboy anaconda-ks.cfg install.log install.log.syslog ss.sh This command indicates that a link to the source file with the same name is created in the home directory to/home/kk/ss.sh Symbolic connection
[Root@a ~]# ln-s/home/
Regular expression with G-parameter: Var kk=//w/w/g;
var kk= new RegExp ("//w//w", "G");
If the regular expression has a specified G parameter global match, the next match is obtained each time the test () is followed. An example is provided:
var s= "AABBCC";
var kk=/(/w/w)/g;
For (i= 0;iDocument. Write ("The above code result is 3 true,1 false, 3 True, and 1 fal
No Components | verification Code
Click here to download the sourceThe relevant pictures are as follows:
Dim Objcanvas
Dim Pointx,pointy,pointcolor
Dim itemp
Dim Safecode
Dim R,g,b,cc,kk
Const Camount = 36 ' text quantityConst ccode = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"Cc=80Kk=30Safecode = ""Session ("Safecode") = ""bgcolor = "FFFFFF"R = Mid (bgcolor,1,2)G = Mid (bgcolor,3,2)B = Mid (bgcolor,5,2) R = Dechex (r)g = Dechex (g)b = Dechex (b)Set Objca
Today, I read the big talk Design Model Book and found that it is really good. I have been wondering about the decoration model. I have understood it tonight. Now I am taking notes. For details, see the relevant sections of this book,
It is mainly parsed.
Using system;Using system. Collections. Generic;Using system. text;
Namespace decoration Mode{Class Program{Static void main (string [] ARGs){Person XC = new person ("coriander ");
Console. writeline ("\ n first dress up :");
Sneakers pqx = n
permissions for the file. Run the following command.
[[Email protected] bin] # chmod + x date
2.3 run the shell program
There are three methods to execute a shell program:
Method 1:
[[Email protected] bin] #./date
Mr. Root, today is:
Tuesday, February 06
Wish you a lucky day!
Method 2:
Another method for executing date is to pass it as a parameter to the shell command:
[[Email protected] bin] # bash date
Mr. Root, today is:
Tuesday, February 06
Wish you a lucky day!
Method 3:
To c
//repeated operation until the scope of existence is empty7 while(r-l>=l){8 intI= (L+R)/2;9 if(k[i]==x)return true;//Find xTen Else if(k[i]1; One ElseR=i; A } - //no X found . - return false; the } - - viod Solve () { - //in order to find a binary search need to sort first +Sort (k,k+n); - + BOOLf=false; A for(intA=0; a){ at for(intb=0; b){ - for(intC=0;c){ - //Replace the most internal loo
Minimum path and matrix path of the matrix
Classic dynamic programming method.
If the given matrix is as follows:
1 3 5 9
8 1 3 4
5 0 6 1
8 8 4 0
Paths 1, 3, 1, 0, 6, 1, and 0 are the smallest paths and values in all paths. 1 + 3 + 1 + 0 + 6 + 1 + 0 = 12, so 12 is returned.
The Code is as follows:
Public class demo5 {Public static void main (String [] args ){Int [] [] array = }};Int [] [] result = minPathSum (array );System. out. println (result [result. length-1] [result [0]. length-1]);}Public
=> 'b', 3 => 'd', 5 => 'f', ), 2 => array ( 7 => 'h', 8 => 'i', 9 => 'j', ),);
My current practice is to create a two-layer Loop
$result = array ();foreach ($arrayA as $k => $v) { foreach ($v as $kk => $vv) { $result[$k][$kk] = $arrayB[$k][$kk]; }}
Is there any more efficient way?
Reply content:
Two Arrays: ArrayA and ArrayB
$arrayA = arr
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.