#25分

1098 Insertion or Heap Sort (25分)

AccordingtoWikipedia:Insertionsort iterates,consumingoneinputelementeachrepetition,andgrowingasortedoutputlist.Eachiteration,insertionsortremovesoneelement...

1078 Hashing (25分)

Thetaskofthisproblemissimple:insertasequenceofdistinctpositiveintegersintoahashtable,andoutputthepositionsoftheinputnumbers.Thehashfunctionisdefinedtobe (&...
代码星球 代码星球·2020-08-09

1089 Insert or Merge (25分)

AccordingtoWikipedia:Insertionsort iterates,consumingoneinputelementeachrepetition,andgrowingasortedoutputlist.Eachiteration,insertionsortremovesoneelement...

1067 Sort with Swap(0, i) (25分)

Givenanypermutationofthenumbers{0,1,2,..., N−1},itiseasytosorttheminincreasingorder.Butwhatif Swap(0,*) istheONLYoperationthatisallowedtous...
代码星球 代码星球·2020-08-09

1066 Root of AVL Tree (25分)(AVL树的实现)

AnAVLtreeisaself-balancingbinarysearchtree.InanAVLtree,theheightsofthetwochildsubtreesofanynodedifferbyatmostone;ifatanytimetheydifferbymorethanone,rebalancingi...
代码星球 代码星球·2020-08-09

1063 Set Similarity (25分)

Giventwosetsofintegers,thesimilarityofthesetsisdefinedtobe /,where N​c​​ isthenumberofdistinctcommonnumberssharedbythetwosets,and N​t​​ ...
代码星球 代码星球·2020-08-09

1062 Talent and Virtue (25分)(水)

About900yearsago,aChinesephilosopherSimaGuangwroteahistorybookinwhichhetalkedaboutpeople'stalentandvirtue.Accordingtohistheory,amanbeingoutstandinginbothtalenta...

1060 Are They Equal (25分)

Ifamachinecansaveonly3significantdigits,thefloatnumbers12300and12358.9areconsideredequalsincetheyarebothsavedas 0 withsimplechopping.Nowgiventhenumber...
代码星球 代码星球·2020-08-09

1059 Prime Factors (25分)

Givenanypositiveinteger N,youaresupposedtofindallofitsprimefactors,andwritethemintheformat N = p​1​​​k​1​​​​×p​2​​​k​2​​​​×⋯&tim...
代码星球 代码星球·2020-08-09

1055 The World's Richest (25分)(水排序)

Forbesmagazinepublisheseveryyearitslistofbillionairesbasedontheannualrankingoftheworld'swealthiestpeople.Nowyouaresupposedtosimulatethisjob,butconcentrateonlyon...

1052 Linked List Sorting (25分)

Alinkedlistconsistsofaseriesofstructures,whicharenotnecessarilyadjacentinmemory.Weassumethateachstructurecontainsaninteger key anda Next poi...

1051 Pop Sequence (25分)

Givenastackwhichcankeep M numbersatmost.Push N numbersintheorderof1,2,3,..., N andpoprandomly.Youaresupposedtotellifagivensequence...
代码星球 代码星球·2020-08-09

1048 Find Coins (25分)

Evalovestocollectcoinsfromallovertheuniverse,includingsomeotherplanetslikeMars.Onedayshevisitedauniversalshoppingmallwhichcouldacceptallkindsofcoinsaspayments.H...
代码星球 代码星球·2020-08-09

1047 Student List for Course (25分)

ZhejiangUniversityhas40,000studentsandprovides2,500courses.Nowgiventheregisteredcourselistofeachstudent,youaresupposedtooutputthestudentnamelistsofallthecourses...

1044 Shopping in Mars (25分)(二分查找)

ShoppinginMarsisquiteadifferentexperience.TheMarspeoplepaybychaineddiamonds.Eachdiamondhasavalue(inMarsdollarsM$).Whenmakingthepayment,thechaincanbecutatanyposi...
首页上一页12下一页尾页