kootenai electric

Discover kootenai electric, include the articles, news, trends, analysis and practical advice about kootenai electric on alibabacloud.com

Hangzhou Electric 1754--i Hate It (line segment tree)

*root +1, Mid +1, right); at returnTree[root].max =Max (A, b); - } - intUpdate (intRootintPosintval) - { - if(Pos //the point is not in a child segment - returnTree[root].max; in if(pos = = Tree[root].left pos = = tree[root].right)//leaves; - returnTree[root].max =Val; to intA, B; +A = Update (2*Root, Pos, Val); -b = Update (2*root+1, POS, Val); theTree[root].max =Max (A, b); * returnTree[root].max; $ } Panax Notoginseng intFind (intRootintLeftintRight ) -

Hangzhou electric acm2665--kth number~~ partition tree

The meaning of the topic: to the point interval [a, b], find the number of K, and POJ2104, just the time limit on the Hdu 5000MS, with my method on the POJ, too, will time out.The code of this problem, change the input of the main function, you can directly AC the POJ on the 2104.This problem, with the division of the method, WR, Tangled up one night, finally gave up, really do not know where the wrong. Then the method of dividing tree was used to learn the establishment and search of the partit

Hangzhou Electric Acm1211--rsa

This problem, similar to the decryption of ciphertext. The meaning of the topic is very clear.Give you the number of P Q e l,l for the second row.Calculate the N and FN first, and then calculate the D.n = p * q;fn = (p-1) * (q-1).Then according to the D * e% fn = 1, calculate d.The key is to seek C. The number num to you is equal to c ^ d% n. c The corresponding ASCLL code is the decrypted character.The following is the code for the AC:#include Hangzhou Elec

Hangzhou Electric Acm1130--how Many Tree? Number of ~~catalan

The recursive formula for the Catalan number is: f (n) = f (n-1) * (4*n-2)/(n + 1);Since n is the maximum of 100, it is necessary to use an array to hold each of the Catalan numbers. You need to use a large number of operations.The following is the code for the AC:# include Hangzhou Electric Acm1130--how Many Tree? Number of ~~catalan

Hangzhou Electric HDU ACM 2199 Can You solve this equation?

Can you solve this equation?Time limit:2000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 11180 Accepted Submission (s): 5151Problem Descriptionnow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 = = Y,can you find its solution between 0 and 100 ;Now try your lucky.Inputthe first line of the input contains an integer T (1Outputfor Each test case, you should just output one real number (accurate up to 4 decimal places), which is the solution of The Equati

Hangzhou Electric 1001 Sum problem

First look at the topicThis problem, according to the meaning of the title, I understand, should be input, each group input line, and then the corresponding output, more than one blank line between the output, but the problem is how to know that he has entered the completed, the following should show the output. Misunderstood by the problem input and output case. It was then replaced by a line of output, followed by the output of the line, and then the input, output, alternating.#include using n

Hangzhou Electric acm1878--Euler circuit

Simple Euler circuit, title.Euler's circuit judgment:1. In the direction graph: The first necessary condition is that the graph is connected, so the vertex's penetration is equal to the degree of the.2. In undirected graphs: the first condition or the graph is connected, followed by the vertex is even several (the degree of the vertex is even)This problem is a graph, so according to the judgment method to write, very simple, the decision does not prove.I use and check the set to determine whethe

Hangzhou Electric 1021--fibonacci Again

Fibonacci AgainTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 43441 Accepted Submission (s): 20755Problem Descriptionthere is another kind of Fibonacci numbers:f (0) = 7, f (1) = one, f (n) = f (n-1) + f (n-2) (n>=2).Inputinput consists of a sequence of lines, each containing an integer n. (n Outputprint the word "yes" if 3 divide evenly into F (n).Print the word "no" if not.Sample Input0 1 2 3 4 5Sample Outputauthorleojay//7 11 18 29 47 76 12

Hangzhou Electric acm1286--to find new friend ~ Euler function application

Euler functionsEuler functions, for positive integer n, the Euler function is the number of the number of n coprime less than or equal to N.The general formula is:F (x) = x * (1-1/p1) * (1-1/p2) * ... * (1-1/PN); P1,p2,p3.....pn is the qualitative factor of X. Each quality factor occurs only once. that is p1≠p2≠....pn; for example 12 = 2 * 2 * 3;2 can only be counted once.With this Oraton-type, you can quickly solve the problem, the beginning I was done in a normal way, it is obvious that the ti

Hangzhou Electric HDU ACM 1085 Holding Bin-laden captive!

(0Outputoutput the minimum positive value that one cannot pay with given coins, one line for one case.Sample Input1 1 30) 0 0Sample Output4Authorlcyafter learning the mother function after the first hand, so that only really understand the meaning of the algorithm will knock him out and according to the specific requirements of the topic to learn the flexibility to pass. The same is the expression of the female function, and then the triple loop, the polynomial multiplication, to determine whic

Hangzhou Electric Acm1301--jungle roads~~ minimum spanning tree

This question, simple minimal spanning tree problem.Just enter the time is more troublesome, the beginning of N, is the number of villages, the following N-1 information, the beginning of the capital letter S and K, is the S village has a k road connection, followed by the K village and the weight value.It's easy to handle the data you've entered.The following is the code for the AC:#include Hangzhou Electric Acm1301--jungle roads~~ minimum spanning t

Hangzhou Electric (save one inch of time, change for a century)

The wrong answer started, it took one hours to find out what was wrong and I was drunk. (Please note after the loop to clear 0, on more than once when the)#include #include int main (){int n,m,i,j,sum=0,num=0;while (scanf ("%d%d", n,m)!=eof){if (n{for (i=n;i{if (i%2==0){Sum+=i*i;}Else{Num+=i*i*i;}}printf ("%d%d\n", sum,num);}Else{for (i=m;i{if (i%2==0){Sum+=i*i;}Else{Num+=i*i*i;}}printf ("%d%d\n", sum,num);}}}Positive solution#include #include int main (){int n,m,i,j,sum=0,num=0;while (scanf ("%

Hangzhou Electric 1201--18 year-old birthday

, -, to, -, to};3 intJudgeintYear )4 {5 if(Year%4==0 Year% -!=0) || Year% -==0)6 return 1 ; 7 Else8 return 0 ;9 }Ten intMain () One { A intI, J, N, y, M, D; - -scanf"%d", n); the while(n--) - { -scanf"%d-%d-%d", y, m, d); - if(M = =2 judge (y) d = = in!judge (y+ -))//No 18-year-old birthday; + { -printf"-1\n") ; + Continue ; A } at intsum =0 ; - for(i = y; i -; i++) - { -Sum + =365 ; - if

Electric Trolley Program

; thein4=1; the Break; About Case 0x43://Braking thein1=0; theIn2=0; thein3=0; +in4=0; - Break; the Case 0x07: Break;//eq for return key, return back to first functionBayi Case 0x15: Break; the Case 0x09: Break; the Case 0x16: Break; - Case 0x19: Break; - Case 0x0d: Break; the Case 0x0c: Break; the Case 0x18: Break; the Case 0x5e:

Hangzhou Electric HDU ACM 1025 constructing Roads in jgshining ' s kingdom

Len is constant, that is, the longest increment of the subsequence is unchanged, then replaced with the smaller element, is to makeFurther elements are more "opportunity" to add to the DP "" at the end of the 1, in other words, the potential for longer sequences increases.Also pay attention to the output format details. Road and roads. Also note that the end of the binary search must be low above high and per "low". Y is greater than the number you are looking forAC:#include Hangzhou

Hangzhou Electric 2027--Statistical vowel

); - intLen =strlen (str); - intA=0, b=0, c=0, d=0, e=0 ; the for(i=0; i) - { - if(Str[i] = ='a') -a++ ; + if(Str[i] = ='e') -b++ ; + if(Str[i] = ='I') AC++ ; at if(Str[i] = ='o') -d++ ; - if(Str[i] = ='u') -e++ ; - } -printf"a:%d\n", a); inprintf"e:%d\n", b); -printf"i:%d\n", c); toprintf"o:%d\n", d); +printf"u:%d\n", e); - if(n!=0) theprintf"\

Hangzhou Electric Acm1027--ignatius and the Princess II

This question, looked for a long time, did not find what the law, Baidu after, only know is the number of the smallest permutation is the first of the enumeration.What a long knowledge!! ~Knowing this rule, you can quickly write, algorithm this header file in another enumeration of the function next_permutation, the smallest permutation of the first, is called Next_permutation I-1 times after the arrangement . The same applies to next_permutation, which means that there are duplicate elements in

Hangzhou Electric Acm1163--eddy ' s digital Roots

The main problem is to find the law, the first time to find out! ~~The topic is to ask for a number of digital root, this so-called digital root is a number of the sum of the numbers, if the number of double digits, repeat the digital root, until the number is a number.This problem is to seek n^n 's digital root.The rules are as follows:The result of N-n multiplication is assumed to be the multiplication of the digital root of s,s, which is equal to the number of n digital root.The following is

Hangzhou Electric Acm1162--eddy ' s picture~~ minimum spanning tree

The problem is the simple application of the minimal spanning tree. At first, did not think of using the smallest spanning tree to do, think of is greedy, when known to use the smallest spanning tree to do, but also made a very serious mistake, is the time complexity of the estimate wrong, leading to the beginning dare not write, thinking of other methods. Think of it as a lesson.The following is the code of the AC, with detailed comments, with a check set to judge the ring, the time complexity

Hangzhou Electric 1014--Uniform Generator

program should print exactly one blank line.Sample Input3 5 the - 63923 99999Sample Output 3 5 Good Choice 20 63923 99999 Good ChoiceConsider a large number; Pay attention to the format;1#include 2 #defineMAX 100010;3 4 intgcdintAintb//greatest common divisor;5 {6 if(!B)returnA;7 Else8 returnGCD (b,a%b);9 }Ten One intMain () A { - intM,n; - while(~SCANF ("%d%d",m,N)) the { - intlen=gcd (m,n); - if(len==1) -printf"%10d%10d G

Total Pages: 15 1 .... 11 12 13 14 15 Go to: Go

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.