• 2024-11-10CF2030D QED's Favorite Permutation 题解
    题目传送门前置知识差分解法对于移动,我们可以无脑进行交换来保证移动,然后将中途交换的位置再交换回去。通过手摸不难发现,\(p_{i}\)能移动到\(i\)当且仅当\(s_{\min(i,p_{i})\sim\max(i,p_{i})}\)中不含有LR子串。反向考虑,即LR子串不被上述区间包含,差分判断即可。
  • 2024-06-11Codeforces Problem 1980B Choosing cubes(基本排序)
    timelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputDmitryhas n
  • 2024-05-21My favorite story
    扩写:Iwokeupinthemiddleofthenightfeelingreallysick.Myheadhurtintensely,andIcouldn'tstopshaking.Drenchedinsweat,Istumbledthroughthedarkhallwaytofindmydad.Whenhesawme,hisfacecreasedwithconcern.Heledmebackto
  • 2024-05-21My favorite story(revised)
    TheStoryofSnowWhiteOnceuponatime,inadistantkingdomtuckedawayinthemountains,aqueengavebirthtoadaughter.Herskinwasaswhiteassnow,herlipsasredasblood,andherhairasblackasebony.Thequeen,inaweofherdaughter'
  • 2024-05-20My favorite story(revised)
    Thatmorning,Iwokeupfeelingastrangeheavinessinmyhead,likemybrainwasbeingweigheddownbyathousandleadbricks.Mybodyfelthot,asifaragingfirewasburningwithinme.Myvisionwasblurred,andtheroomseemedtospinaroundme.With
  • 2024-05-20My favorite story
    "Putitonherchair",farther'srandomvoicecamefromdownstairs.Hereturedhomehalfanhourlater.Whatdidhedo?Whatthingdidheputonmychair?Curiosityarose.ButIcouldnotstopcrying,myeyesgettingred.Withsomeminutest
  • 2024-05-19My favorite story(revised)
    Iwasaboywhothoughtlifewaspointless.Youcouldoftenhearmecomplainingtomyfather“Whatisthemeaningoflife?”Myfatherwouldalwayslookatmewithlovingeyes,butneveranswerdirectly.Onedaymyfatheraccidentallyfoundanordinarystone.H
  • 2024-05-19My favorite story(rivised)
    MyfavoritebookistheWhen“Journeytothewest."JourneytotheWest"isacaptivatingtalethatfollowsthemonkXuanzangandhisthreedisciples-themischievousyetwiseMonkeyKing,thegluttonousyetlovablePigsy,andthesteadfastFria
  • 2024-05-19My favorite story (revised)
    Recently,thereisabigcatwithyellowandwhitestripesinthehouse,whocaughtmanycompanionsofuswhilewewerestealingsomepiecesoffood.Thecatalwaystookimmediateactionwhenwewerestealingthosepiecesoffoodinthekitchen,sowewer
  • 2024-05-19My favorite story(revised)
    Howclearwasaday!Warmsunlightshoneontheseawhiletheskywasassereneanddeepasasapphire.Rollingintheseacarefreely,Iachedforfreshair.Saltybreezewaftedthroughtheseasurface.Stillimmersinginfreedomandrelaxation,alargefis
  • 2024-05-19My favorite story(revised)
    AbouttwentyminutesIwaited,atallmaninalongovercoat,withcollarturneduptohisears,hurriedacrossfromtheoppositesideofthestreet.Hewentdirectlytome."Isthatyou,JimmyWells?"Icried.Afterreceivingapositiveresponse,wecla
  • 2024-05-18My favorite story(revised)
    Thewinternighthadcome,whichwasextremelycold.Ifeltnearlyfrozen.Iwalkedthestreets,shiveringinmyraggeddresswithmanyholesonit.Eventhoughfeelingcold,hungryandtired,Icouldn'tceasesellingmatches.Ineededtobegforafewco
  • 2024-05-18my favorite story (revised)
    Irememberfondlygazingatmymotherfromafar,admiringhereleganceandbeauty.However,asIknewheronlysuperficially,itwasdifficultformetofeeladeepsenseofloveorlongingforherwhenshewasnolongeraround.Truthfully,Ididn't
  • 2024-05-13My favorite story
    TheStoryofSnowWhiteInadistantkingdom,aqueengavebirthtoadaughteraswhiteassnow,andshewasnamedSnowWhite.However,thequeenpassedawaysoonafter,leavingSnowWhitewithherfather,theking.Whenthekingremarriedawomanwhowas
  • 2024-05-13My Favorite Story
    Everyonehasstory.Andalsohasthestorytheyloved.Myfavoritestoryisabout《Journeytothewest》.Inthestory,Theauthor,WuChengen,characterizedfourfamouscharacter.Theirfourpersonalityaredistinct.Onthewaytothewest,Theyhadmanyinterest
  • 2024-05-13My favorite story
    IthinkmylifeismeaninglessandemptybecauseIthinkthatI'msonormalandbourgeoisthatnoonewilllikeme.Oneday,myfatheraskedmetotakeastonetoamarketandjustraisetwofingerswithoutspeakingifsomeoneinquiresitsprice.Alout
  • 2024-05-13My favorite story
    Howclearwasaday!Warmsunlightshoneonthesunwhiletheskywasastranquilandmysteriousassapphire.Irolledintheseahappily.Stillimmersinginhappiness,alargefishingnetcaughtmewhenIwasnotpayingattention.Hearingjoyfulvoice“bi
  • 2024-05-13My favorite story
    Thefirstpointofviewoftheyoungmouse:Recently,thereisabigcatinthehouse,whocaughtmanycompanionsofuswhilewewerestealingfood.Oneday,wehadameetingtotalkaboutthewaytodealwithourcommonenemy.Somesaidthis,andsomesa
  • 2024-05-13My Favorite Story
    WhenrealizingthemanbesidemewasnotJimmyWells,Istoppedsuddenlyandreleasedhisarm.Iwasconfusedandthenpanicked.“Thesecretofmysuccesswasknownbyastranger,orapoliceman?"Mymindwasinastateoftormoil,andIwasstrugglingto
  • 2024-05-13My Favorite Story
    Iwasaboywhothoughtlifewaspointless.Youcouldoftenhearmecomplainingtomyfather“Whatisthemeaningoflife?”Myfatherwouldalwayslookatmewithlovingeyes,butneveranswerdirectly.Onedaymyfatherfoundanordinarystone.Hehandedtom
  • 2024-04-12python-字典的学习
    '''在Python中,字典字是一系列键—值对值。每个键都与一个值相关联,你可以使用键来访问与之相关联的值。与键相关联的值可以是数字、字符串、列表乃至字典。事实上,可将任何Python对象用作字典中的值。在Python中,字典用放在花括号{}中的一系列键—值对表示'''customer={'name
  • 2024-04-11CF617E XOR and Favorite Number 题解
    想了好久才明白zz来源?:莫队题单题目大意给定一个长度为\(n\)的序列\(a\),然后再给一个数字\(k\),再给出\(m\)组询问,每组询问给出一个区间,求这个区间里面有多少个子区间的异或值为\(k\)。\(1\len,m\le10^5\)\(0\lek,a_i\le10^6\)\(1\lel_i,r_i\len\)题
  • 2024-04-04CodeForces 1942F Farmer John's Favorite Function
    洛谷传送门CF传送门考虑一些复杂度带根号的做法。考虑分块,对于一个块,我们需要处理出一个数经过这个块会变成哪个数。以下假设块长\(\ge10\)(最后一个块块长可能\(<10\),暴力处理即可)。观察这个递推式\(f_i=\left\lfloor\sqrt{f_{i-1}+a_i}\right\rfloor\),发现对于一
  • 2023-10-16字典嵌套
    #Thisprogramstorespeople'sfavoritenumbers,anddisplaysthem.favorite_numbers={'eric':[3,11,19,23,42],'ever':[2,4,5],'willie':[5,35,120],
  • 2023-10-13CF1523F Favorite Game
    当前的状态有:传送门的激活状态,已经完成的任务数量,当前的位置(传送门/任务),经过的时间。显然我们会先将所有任务按照\(t_i\)升序排序。把前三维列为状态,后一维列为答案,此时我们可以得到一个状态数为\(O(2^nm^2)\),转移为\(O(m)\)的dp。状态数很没救,显然要被优化。但单拉出来哪