Академический Документы
Профессиональный Документы
Культура Документы
-he%e the%e is 1**1 sevens. -hat a%e the !inal two digits. /. &wo student o! school and !ew student o! college took 'a%t in a chess tou%nament. (ach student 'layed once against othe%. &he two students o! school got 0 'oints each while each o! the college student got same 'oint. I! in each match winne% gets 1 and lose% gets * 'oint o% "oth 'laye% gets 1 'oint i! the game is a d%aw the calculate how many college student 'a%tici'ated. 2. Show that
1 1 1 1 ... = log N log 3 N log 1** N log 1** ! N
x 1 x x3 x / x x 3 x / x 2... x n3 x n x n1 x n x n x n1 x n x 1 x n1 x n x 1 x x n x 1 x x3 =*
&hen '%ove n is divisi"le "y /. 7. 8ou have to 'ack N s#ua%es o! same si9e :side length S; inside a ci%cle o! %adius <. (ach s#ua%e =>S& touch the ci%cile?s "ounda%y at (@+C&48 two 'oints. )ind the ma5imum 'ossi"le value o! S. Give you% answe% in te%ms o! < and N. 0. )ind the ne5t )A>< te%ms !o% the !ollowing se#uence, *, 1, , 3, 3, 11, *, 37, 30,
B. $ack th%ee s#ua%es o! same si9e :side length S; inside an e#uilate%al t%iangle o! side length & , what is the minimum value o! &. Give you% answe% in te%ms o! S. ans: &C=in D SE: s#%t:3; F 3/ ; 1*.8ou have two kinds o! a%ithmetic o'e%ation6 eithe% Dou"le cu%%ent value, o% inc%ement cu%%ent value. Sta%ting !%om 1 !ind the minimum num"e% o! o'e%ations to meet *1*. Show the se#uence. 11.8ou and you% !%iend a%e 'laying a game. &he%e a%e N sticks. +ny 'laye% can take away at least 1 stick and at most G sticks :G H N;. &he 'laye% who !inds no sticks le!t loses. 8ou sta%t the game. -hat is the condition o! N and G so that you can gua%antee that you will win :no matte% how well you% !%iend 'lays;.
IN'!$ &he !i%st line o! the !ile in'ut contains a 'ositive num"e% n. &he !ollowing line contains the num"e%s a 1 , a , ... , a n se'a%ated "y a single s'ace. CON1$/AIN$1 1 n1* 2 ; 1 a i1* 2 )o% test cases wo%th 12 'oints n will "e less than 1***. O!$'!$ &he !i%st line o! out'ut should contain a single num"e%, the %e#ui%ed value. #2AM'&# IN'!$ AN0 O!$'!$ Inp t 2 11111 O tp t 1
'/O3/AMMIN3 1!33#1$ION >se long long dataty'e to calculate the answe%. &he !o%mat s'eci!ie% !o% long long is 45lld6.
$as% 7. /o nd $rip
'/OB&#M 8ou% team decided to take a %ound t%i' in the host count%y a!te% the com'etition. 8ou want to t%avel to a destination city and %etu%n to the sta%ting city. &he only %e#ui%ement you% team s'eci!ied is that the !o%wa%d %oute to the destination city and the %etu%n %oute "ack to the sta%ting city must contain the least 'ossi"le num"e% o! common %oads. :+ %oute can not contain any %oad twice o% mo%e times.; 8ou a%e to w%ite a '%og%am that com'utes two %outes "etween the sta%ting city and the destination city so that the num"e% o! common %oads in the two %outes is as small as 'ossi"le. IN'!$ &he !i%st line o! the in'ut contains two intege%s, S and D :S HI D;, the la"els o! the sta%ting and the destination cities, %es'ectively. &he second line contains two intege%s, N and M, whe%e N :3HD N<= 1***; is the num"e% o! the cities and M : HD = HD 1*****; is the num"e% o! the %oads "etween the cities. &he cities a%e la"eled !%om 1 to N. (ach o! the ne5t M lines in the !ile contains two intege%s, P and Q :1HD P, Q HD N, P HI Q;, meaning that the%e is a two6way %oad "etween city P and city Q. &he%e is at most one %oad "etween any two cities. O!$'!$ &he !i%st line o! the out'ut must contain one intege%, the least 'ossi"le num"e% o! common %oads o! the !o%wa%d and the %etu%n %outes. &he second line should contain a !o%wa%d %oute as a se#uence o! city la"els, including the sta%ting and ending city. &he thi%d line should contain a %etu%n %oute as a se#uence o! city la"els :again including the sta%ting and ending cities;. I! the%e a%e mo%e 'ossi"le 'ai%s o! %outes with the same least num"e% o! common %oads then you% '%og%am may out'ut any one o! them. I! the%e is no %oute !%om the sta%ting city to the destination city then the !i%st and only line must contain 61. #2AM'&# IN'!$ AN0 O!$'!$ Inp t 13 70 1 13 3 / /2 23 13 32/ /273 1 O tp t
72 37
3/A0IN3 I! the !i%st line o! the out'ut !ile contains the co%%ect answe% then you o"tain /*J 'oint on that testcase. I! the !i%st line contains a co%%ect solution and the second and thi%d lines contain co%%ect %outes then you o"tain !ull sco%e on that testcase.
Inp t 12
O tp t 12
Inp t
O tp t
3/ 1* *
$as% *. 1tone
&he%e a%e some stones lying on the %oad. 8ou have to a%%ange them in non6dec%easing o%de% o! thei% weight. 8ou can move any stone to any 'osition. 8ou want to minimi9e the total weight :sum o! the weight o! the stones; you have to move. Inp t &he !i%st line o! the !ile stone.in contains a 'ositive num"e% n. &he !ollowing line contains the num"e%s a1,a ,.....,an se'a%ated "y a single s'ace. Constraints 1 HDnHD1*N2O1HDaiHD1*N/. )o% test cases wo%th 2* 'oint, n will "e less than o% e#ual to 1***. O tp t &he !i%st line o! stone.out should contain a single intege%: minimum total weight you have to move. In'ut / 71 3 / 71 2 11 3/230 Aut'ut 3 7 / 7 11