当前位置 :
【跪求高手帮忙解答ACM程序代码Theinputfilewillcontainoneormorelines,eachlinecontainingoneintegernwith,representingthenumberofcitiesinthecountry.Inputisterminatedbyavalueofzero(0)forn.输入3456789】
1人问答
更新时间:2024-05-05 00:53:03
问题描述:

跪求高手帮忙解答ACM程序代码

Theinputfilewillcontainoneormorelines,eachlinecontainingoneintegernwith,representingthenumberofcitiesinthecountry.

Inputisterminatedbyavalueofzero(0)forn.

输入34567891011120输出252431123816

Toputanendtothisproblem,theUniversityofUlmhasdevelopedacontingencyschemefortimesofpeakloadtocutoffnetaccessforsomecitiesofthecountryinasystematic,totallyfairmanner.Germany'scitieswereenumeratedrandomlyfrom1ton.Freiburgwasnumber1,Ulmwasnumber2,Karlsruhewasnumber3,andsooninapurelyrandomorder.

Thenanumbermwouldbepickedatrandom,andInternetaccesswouldfirstbecutoffincity1(clearlythefaireststartingpoint)andthenineverymthcityafterthat,wrappingaroundto1aftern,andignoringcitiesalreadycutoff.Forexample,ifn=17andm=5,netaccesswouldbecutofftothecitiesintheorder[1,6,11,16,5,12,2,9,17,10,4,15,14,3,8,13,7].TheproblemisthatitisclearlyfairesttocutoffUlmlast(afterall,thisiswherethebestprogrammerscomefrom),soforagivenn,therandomnumbermneedstobecarefullychosensothatcity2isthelastcityselected.

林正海回答:
  题目没发完啊
最新更新
PC端 | 移动端 | mip端
问答网(wenda2.com)汇总了汉语字典,新华字典,成语字典,组词,词语,在线查字典,中文字典,英汉字典,在线字典,康熙字典等等,是学生查询学习资料的好帮手,是老师教学的好助手。
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。

邮箱:联系方式:

Copyright©2009-2021 问答网 wenda2.com 版权所有 闽ICP备2022000227号-1