h d electric

Read about h d electric, The latest news, videos, and discussion topics about h d electric from alibabacloud.com

Hangzhou Electric 1878 Euro-pull circuit

) - { inmemset (D,0,sizeof(d));//Array Clear 0 - for(i =1; I ) to { +fa[i]=i; - } thescanf"%d",m); * for(i =0; I ) $ {Panax Notoginsengscanf"%d%d",a,b); -d[a]++; thed[b]++;//record the degree of each point + F1 (A, b); A } theCnt=0; key=0; + for(i =1; i) - { $ if(D[i]%2)//To judge that each point is an even degree $ { -key=1; - } the if(i = = Fa[i])//Judging there's no indepen

Hangzhou Electric 2012

1#include 2#include 3 intMain ()4 {5 intn,m,i,j,t,x,y;6 while(~SCANF ("%d%d", x,y) (x| |y))7 {8 for(i=x,t=1; ii)9 {Tenx=i*i+i+ A; OneN= (int) sqrt (Double) x); A for(j=2; jj) - { - if(! (%j)) the Break; - } - if(jN) -t=0; + } - if(t) +printf"ok\n"); A Else atprintf"sorry\n"); - } - return 0; -}Hangzhou Electric

Hangzhou Electric ACM 1181 Transformation Course DFS

inputs. Output "Yes" If Harry can finish his homework, otherwise output "No."(Do not ignore the period)Sample Inputsosoonrivergoesthemgotmoonbeginbig0 Sample Outputyes. Harry can read this mantra: "Big-got-them."#include #include#include#includestring.h>using namespacestd;BOOLvis[ +];Charstr[ +][ +]; BOOLBFsintN) {Queueint>que; intA, Len; for(inti =0; I //first, the first letter is a b queue. { if(str[i][0] =='b') {Que.push (i); Vis[i]=true;//indicates that the word has been marked.

Hangzhou Electric 2016

1#include 2 intMain ()3 {4 inta[ -],n,i,t,k;5 while(~SCANF ("%d", n) N)6 {7 for(i=k=0; ii)8 {9scanf"%d",a[i]);Ten if(A[i]//looking for the minimum value position Onek=i; A } - if(k)//not the first one, then the first exchange. - { thet=a[0]; -a[0]=A[k]; -a[k]=T; - } + for(i=0; ii) - if(i)//Control output Format +printf"%d", A[i]); A Else atprintf"%d", A[i]); -printf"\ n"); - } - ret

Hangzhou Electric 1106

files and C + + input and output header files.Function Two:Char *strtok (char s[], const char *d); This is the prototype, which decomposes the string into a set of strings. The string that s wants to break down. D is a delimiter character because all D is substituted for the first execution of this function, so you need to change s to NULL when you call it again (the C language takes it as the last character of the string to represent the end of the string. ") ").Function Three:Atoi () (represe

Hangzhou Electric OJ 1004 realization and some traps of attention

The 1004 question is actually very simple, is wants you to count the most balloons the number, but in the output time but needs to be careful carefully, conforms to the question request.In the output is the first note is the output order: If there are multiple numbers of the same color, first input first output, such as,RedGreenRedGreenThis situation requires an outputRedGreenPost the AC code:#include   Hangzhou Electric OJ 1004 realization and some t

HDU 5705 Clock (2016 Hangzhou Electric Girls Session 1004)--angle chase and problem

means that all the time is converted into smaller units (that is, multiplied by 11), which avoids the problem of precision.See the code for details:1#include 2 intMain ()3 {4 inth,m,s,a,da,tots= A*3600* One, kase=1;5 while(SCANF ("%d:%d:%d", h,m,s) = =3)6 {7 intTar = One* (h*3600+m* -+s);8scanf"%d",a);9Da = the-2*A;Ten intCNT = A * -, F =1; One //The position at the beginning is a° (obviously the first minute is the second hand in front) . A while(c

Hangzhou Electric 2803 The MAX (sort)

descriptiongiving N integers, V1, V2,,,, Vn, you should find the biggest value of F.Inputeach test case contains a single integer N (11#include 2#include 3 using namespacestd;4 inta[100000];5 intMain ()6 {7 __int64 n,j;8 while(SCANF ("%i64d", n) N)9 {Ten for(__int64 i=0; i) One { Ascanf"%d",a[i]); - } -Sort (a,a+n); thej=a[n-1]*( .-n); - for(__int64 i=1; i ) -j=j+a[n-1-i]; -printf"%i64d\n", j); + } -}Hangzhou El

Hangzhou Electric 5053 The Sum of the cube (for the cubic and in the interval) to play the table method

Descriptiona range is given, the begin and the end are both integers.You should sum the cube of all the integers in the range. Inputthe first line of the input was T (1 Each case of input is a pair of integer A, a (0 1#include 2__int64 a[1000000]={0,1};3 intMain ()4 {5 for(__int64 i=1; i1000000; i++)6 {7a[i]=a[i-1]+i*i*i;8 }9__int64 t,k=0;;Tenscanf"%i64d",t); One while(t--) A { - __int64 m,n; -scanf"%i64d%i64d",m,n); theprintf"Case #%i64d:%i64d\n", ++k,a[n]-a[m-1]); - }

ACM INTRODUCTION Hangzhou Electric 1001 questions about overflow considerations

. Then a long time to think about the reason, finally after I Baidu to know where the problem.When n (n+1) is multiplied, it overflows. The title asks "may assume the result is in the range of 32-bit signed integer", which requires that the sum is a 32-bit signed integer. The sum of the test data given by OJ (n (n+1)/2) must be within the range of 32-bit integers, but (n (n+1)) is not necessarily. The reason you can infer WA should be here. You can subtly change the formula:Putsum=n* (n+1)/2;Swi

Poj2117 Electricity (electric)

#include#includeusing namespaceStd;inlineintRd () {intx=0, f=1; CharCh=GetChar (); for(;! IsDigit (CH); Ch=getchar ())if(ch=='-') f=-1; for(; isdigit (ch); Ch=getchar ()) x=x*Ten+ch-'0'; returnx*F;} InlinevoidWriteintx) { if(x0) Putchar ('-'), x=-x; if(x>9) Write (x/Ten); Putchar (x%Ten+'0'); return ;}intn,m;inthead[100006];intnxt[200006],to[200006];intTotal=0;voidAddintXinty) { Total++; To[total]=y; Nxt[total]=Head[x]; HEAD[X]=Total ; return ;}intdfn[100006],low[100006];inttot=0;intnum[100

Hangzhou Electric---2053 Switch Game

Problem Description There is many lamps in a line. All of the themare off at first. A series of operations is carried out on these lamps. On thei-th operation, the lamps whose numbers is the multiple of I change thecondition (on to off and off).Input Each test case contains only a number n (0Output output The condition of the n-th lamp after infinity operations (0-off, 1-on).Sample Input 15Sample Output 10HintConsider the second test case:The initial condition:0 0 0 0 0 ...After the first Operat

Hangzhou Electric 1795 The least one

The least oneTime limit:9000/3000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 492 Accepted Submission (s): 184Problem Description in the RPG game ' go back Ice Age ' (I decide to develop the game after my undergraduate education), all Heros has their own respected value, and the skill of killing monsters is defined as the following rule:one hero can Ki LL the monstrers whose respected values is smaller then himself and the both respected values have none common

Hangzhou Electric 1795--the least one

positive.Input the first line have one integer Q, then Q lines follow. In the Q lines there are an integer Mi, 0Output for each case, there is Q results, in each result, you should output the value of the hero you'll dispatch to C Omplete the task.Sample Input237Sample Output511AuthorwangyeSource2008 "Insigma International Cup" Zhejiang Collegiate Programming Contest-warm up (4)Recommendwangye | We have carefully selected several similar problems for you:1793 1796 1797 1794 1798 test instructio

Hangzhou Electric 1242--rescue (bfs+ priority queue)

)); in -current.x=x; tocurrent.y=y; +Current.time=0; -vis[current.x][current.y]=1; the Q.push (current); * $ Panax Notoginseng while(!q.empty ()) - { the +Current=q.top (); A Q.pop (); the for(intI=0;i4; i++) + { -next.x=current.x+dir[i][0]; $next.y=current.y+dir[i][1]; $ - if(next.x>=0next.x0next.y'#'!Vis[next.x][next.y]) - { the - if(map[next.x][next.y]=='R')Wuyi returncurrent.time+1; the

Hangzhou Electric 1241--oil Deposits (DFS)

input; Otherwise 1 Outputfor each grid, output the number of distinct oil deposits. The different pockets is part of the same oil deposit if they is adjacent horizontally, vertically, or diagonally. An oil deposit won't contain more than pockets.Sample INPUT1 1 * 3 5 *@*@* **@** *@*@* 1 8 @@****@* 5 5 ****@ *@@*@ *@**@ @@@*@ @@**@ 0 0Sample Output0 1 22Sourcemid-central USA 1997Recommendeddy | We have carefully selected several similar problems for you:1016 1010 1312 1242 1240//Mark →→1#include

Prime Ring problem (Hangzhou electric 1016) (DFS)

Prime Ring problemTime limit:4000/2000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 28204 Accepted Submission (s): 12561Problem Descriptiona Ring is compose of n circles as shown in diagram. Put Natural number 1, 2, ..., n into each circle separately, and the sum of numbers in the adjacent circles should is a PR Ime.Note:the number of first circle should always be 1.INPUTN (0 Outputthe output format is shown as sample below. Each row represents a series of cir

Hangzhou Electric HDU ACM 1175 repeatedly see (Trouble of BFS)

input data. The first row of each group of data has two positive integer n,m (0Note: There is no relationship between inquiries, it is for the current state!OutputEach set of input data corresponds to one row of output. If you can eliminate the output "YES", you cannot output "no".Sample InputSample OutputYesnonononoyes This topic at that time to pit me an afternoon time .... The code is flawed, and there are always unexpected letters, and the most pit is that dir array elements are not the sam

Hangzhou Electric HDU 1312 Red and Black (Super simple Dfs)

)Outputfor each data set, your program should output a line which contains the number of tiles he can reach from the Initia L tile (including itself).Sample Input6 9....#......#..............................#@...#.#. #.11 9.#..........#.#######. #.#.....#.. #.#.###.#.. #.#[email protected]#.#. #.#####.#.. #.......#.. #########............ 11 6..#. #.. #....#.. #.. #....#.. #.. ###.. #.. #.. #@...#.. #.. #....#.. #.. #.. 7 7..#.#....#.#. ###.###[email protected]###.###. #.#....#.#.. 0 0Sample Out

Hangzhou Electric---1108 least common multiple

Least common multipleTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 38681 Accepted Submission (s): 21606Problem DescriptionGiven two positive integers, calculate the least common multiple of these two numbers.InputThe input contains multiple sets of test data, with only one row per group, including two positive integers not greater than 1000.OutputFor each test case, the least common multiple of these two numbers is given, and each instance ou

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.