Download presentation
1 -

CroatianOpenCompetitioninInformaticsRound4January16th2021Tasks


TaskTimelimitMemorylimitPointsPizza1second512MiB50Vepar15seconds512MiB70Hop1second512MiB110Janjetina15seconds512MiB110PatkiceII2seconds512MiB110Total450CroatianOpenCompetitioninInformaticsRound4Januar

morton's Recent Documents

bulk carrier
bulk carrier

Aatthe city of Hudson headed to AlbanyName DateTens Hundreds Thousandsof TonsMany of the big ships that travel to and from the Port of Albany are bulk carriers They carry hugeloadsof loose material su

published 0K
KindergartenK
KindergartenK

1stgrade2ndgrade3rdgrade4thgrade5thgrade6thgrade7thgrade8thgradeSchoolMY CHILD146S LEARNINGaParent146s Guideto theIowa CoreThis guide provides an overview of what your child will learn by the end of 5

published 0K
Inhouse aluminum fabrication includes CNC routers brake presses shear
Inhouse aluminum fabrication includes CNC routers brake presses shear

PONTOONSPONTOONSBentleyBentleyAt Bentley our dedication to quality and cra31smanship runs deep 30at is why we make our own components such as furniture canvas work tubes and railings 30is ensures qual

published 0K
Creating a New Quiz or Exam
Creating a New Quiz or Exam

Page 1This document walks you through the process of creating an assessment from a Question BankUserscancreateassessmentstoinclude questions thathavebeen enteredintoExamSoft Itisrecommendedtotagquest

published 0K
RODUCTANUAL
RODUCTANUAL

17330 Series 7330AGNETOSTRICTIVEONTROLS 7330 Pro-Stik IItechnology A single level output is provided with eld gurable 4mA and 20mA points in an intrinsically guration requires no calibration duri

published 0K
1921 Nature Publishing Group
1921 Nature Publishing Group

NOVEMBER 17 1921 NATURE experiments using the K lines from tungsten effective Ao-196 A reflected from rock-salt and measured the absorption coefficient of the secondary radiation excited by these rays

published 0K
Office of Foreign Assets Control US Department of the Treasury
Office of Foreign Assets Control US Department of the Treasury

OFFICE OF FOREIGN ASSETS CONTROL REPORT OF LICENSING ACTIVITIES PURSUANT TO THE TRADE SANCTIONS REFORM AND EXPORT ENHANCEMENT ACT OF 2000 July - September Overview This report is submitted pu

published 0K
1452832 Chinese sch   Prescribing Information
1452832 Chinese sch Prescribing Information

Wright Medical Technology Inc Wright Medical EMEA5677 Airline RdSCH 145283-28 A C D E E F G H 1 ghDYiHlpNMPIKSTERILEGASSCHChart1qkCharts11/24/08401PMPage18-/MPrsMPrsUHMWPE1 234TiTi6Al4VCoCr

published 0K
Download Section

Download - The PPT/PDF document "" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.






Document on Subject : "CroatianOpenCompetitioninInformaticsRound4January16th2021Tasks"— Transcript:

1 CroatianOpenCompetitioninInformaticsRoun
CroatianOpenCompetitioninInformaticsRound4,January16th2021Tasks TaskTimelimitMemorylimitPoints Pizza1second512MiB50Vepar1.5seconds512MiB70Hop1second512MiB110Janjetina1.5seconds512MiB110PatkiceII2seconds512MiB110 Total450 CroatianOpenCompetitioninInformaticsRound4,January16th2021TaskPizza1second/512MiB/50points TaskPizza Afteralongdayandmiserableatwork,Mirkodecidedtoorderapizzafordinnertocheerhimselfup.Inabigpileofpapersonhisdesk,hefoundayerofanearbypizzarestarant.Therestarantoersmdierentpizzas.Pizzatoppingsarelabeledwithpositiveintegers.i-thpizzahaskitoppings,withlabelsbi;1;bi;2;:::;bi;ki.Mirkoisverypickywhenitcomestofood.Hedoesn'tlikentoppings,thosewithlabelsa1;a2;:::;an,sohewantstoorderapizzathatdoesn'tcontainanyofthosetoppings.DeterminethenumberofpizzasthatMirkocanorder.InputTherstlinecontainsanintegern(1n100),thenumberoftoppings,followedbyndistinctintegersai(1ai100),thelabelsoftoppingsMirkodislikes.Thesecondlinecontainsanintegerm(1m100),thenumberofpizzas.Thefollowingmlinesdescribethepizzas.Thei-thlinecontainsanintegerki(1ki

2 ;100),thenumeroftoppings,followedbykidis
;100),thenumeroftoppings,followedbykidistinctintegersbi;j(1bi;j100),thelabelsoftoppingsonthei-thpizza.Thepizzas,i.e.thesetsoftoppings,willbedistinct.OutputOutputthenumberofpizzasthatMirkocanorder.ScoringIntestcasesworth20pointsitholdsn=1andk1=k2==km=1.Examplesinput123111213output2 input212421431232343357output2 input143111213output3 1of8 CroatianOpenCompetitioninInformaticsRound4,January16th2021TaskVepar1.5seconds/512MiB/70points TaskVepar Twointervalsofpositiveintegersfa;a+1;:::;bgandfc;c+1;:::;dgaregiven.Determinewhethertheproductc(c+1)disdivisiblebytheproducta(a+1)b.InputTherstlinecontainsasingleintegert(1t10),thenumberofindependenttestcases.Eachofthefollowingtlinescontainsfourpositiveintegersai;bi;ci;di(1aibi107;1cidi107).OutputOutputtlinesintotal.Forthei-thtestcase,outputDA(Croatianforyes)ifai(ai+1)bidividesci(ci+1)di,andoutputNE(Croatianforno)otherwise.ScoringIntestcasesworth10pointsitholdsai;bi;ci;di50.Intestcasesworthadditional20pointsitholdsai

3 ;bi;ci;di1000.Intestcasesworthaddit
;bi;ci;di1000.Intestcasesworthadditional10pointsitholdsai=1.Examplesinput2910362579outputDANE input612341423231413241922555755571922outputDANEDADADADAClaricationoftherstexample:Wehave910=90and3456=360.TheanswerisDAbecause90divides360.Wecalculate2345=120,whichdoesn'tdivide789=504.ThusthesecondanswerisNE. 2of8 CroatianOpenCompetitioninInformaticsRound4,January16th2021TaskHop1second/512MiB/110points TaskHopnJeremiahwasabullfrogWasagoodfriendofminenTherearenwaterlilies,numbered1throughn,inaline.Onthei-thlilythereisapositiveintegerxi,andthesequence(xi)1inisstrictlyincreasing.Enterthreefrogs.Everypairofwaterlilies(a;b),whereab,mustbelongtofrog1,frog2,orfrog3.Afrogcanhopfromwaterlilyitowaterlilyj&#x-277;iifthepair(i;j)belongstoit,andxidividesxj.Distributethepairsamongthefrogssuchthatnofrogcanmakemorethan3consecutivehops.InputTherstlinecontainsapositiveintegern(1n1000),thenumberofwaterlilies.Thesecondlinecontainsnpositiveintegersxi(1xi1018),thenumbersonthewaterlilies.OutputOutputn�1lines.Inthei-thline,outp

4 utinumbers,wherethej-thnumberisthelabelo
utinumbers,wherethej-thnumberisthelabelofthefrogtowhich(j;i+1)belongs.ScoringSubtaskPointsConstraints 110n302100Noadditionalconstraints.Ifinyoursolutionsomefrogcanmakekconsecutivehops,wherek�3,butnofrogcanmakek+1consecutivehops,yourscoreforthattestcaseisf(k)xpoints,wheref(k)=1 108����&#x]TJ ;� -1;.93; Td;&#x [00;&#x]TJ ;� -1;.93; Td;&#x [00;&#x]TJ ;� -1;.93; Td;&#x [00;&#x]TJ ;� -1;.93; Td;&#x [00;:11�kif4k5;8�bk=2cif6k11;1if12k19;0ifk20;andxisthenumberofpointsforthatsubtask.Thescoreforsomesubtaskequalstheminimumscorewhichyoursolutiongetsoveralltestcasesinthatsubtask. 3of8 CroatianOpenCompetitioninInformaticsRound4,January16th2021TaskHop1second/512MiB/110points Examplesinput8346912183672output1231231231231231231231231231 input210101output1Claricationoftherstexample: Thefrogsaremarkedblue(1),green(2),andred(3).Thebluefrogcanhopfromwaterlilyx1=3towaterlilyx4=9,thentowaterlilyx7=36,andthentox8=72.Thesearetheonlythreeconsecutivehopsanyfrogcanmake.Th

5 egreenfrogcanhopfromwaterlilyx2=4towater
egreenfrogcanhopfromwaterlilyx2=4towaterlilyx5=12,andthentox7=36,because4divides12,and12divides36.Thosearetwoconsecutivehops.Theredfrogcannothopfromwaterlilyx2=4towaterlilyx3=6because6isnotdivisibleby4.Nofrogcanmakemorethanthreeconsecutivehops. 4of8 CroatianOpenCompetitioninInformaticsRound4,January16th2021TaskJanjetina1.5seconds/512MiB/110points TaskJanjetina AfterrestaurantsalloverCroatiaclosedbecauseofthelockdown,Mr.Malnarwasrstoverwhelmedwithsadness.Buthesoonrealizedthattherewasnopointinbeingsad,andhedecidedthatassoonastherestaurantsreopen,hewilltravelaroundCroatiaandtreathimselfwiththebestlambCroatianrestaurantscanoer.Mr.Malnarknowsaboutncitieshecouldvisit,thathelabeledwithintegersfrom1throughn.Also,heknowsaboutn�1two-wayroadsthatconnectthosecities,insuchawaythatitispossibletotravelbetweenanytwocities.Oneveryroadthereisarestaurantthatserveslamb,andMr.Malnarknowshowmanykilogramsoflambhecanorderineachone.Hewillchoosetwodierentcitiesxandy,andtravelfromxtoyviatheshortestpath,i.e.thepaththatusestheminimalnumberofroads.Hewillstopatexactlyonerestaurant,theonewherehecano

6 rderthemaximumamountoflamb(iftherearemul
rderthemaximumamountoflamb(iftherearemultiplesuchrestaurants,hewillchooseanyofthem),andhewillofcourseeatallthelambheorders.Mr.Malnarconsidersapathoflengthlonwhichheeatswkilogramsoflambtobesatisfactoryifw�lk.Thelengthofapathisequaltothenumberofroadsthatitgoesthrough.Hewondershowmanyorderedpairsofdistinctcities(x;y)thereare,suchthattheshortestpathfromxtoyissatisfactory.Heisverybusy,soheasksyoutocalculatetheanswerforhim.InputTherstlinecontainsintegersnandk(1n;k100000),thenumberofcities,andthesatisfactionthreshold.Eachofthefollowingn�1linescontainsthreeintegersx,yandw(1x;yn;x6=y;1w100000),whichmeansthatthereisaroadthatconnectsxandy,andthereisarestaurantonthatroadwhereMr.Malnarcanorderwkilogramsoflamb.OutputOutputthenumberoforderedpairsofdistinctcities(x;y),suchthattheshortestpathfromxtoyissatisfactory.ScoringSubtaskPointsConstraints 1151n1000235Citiesiandi+1(1in�1)aredirectlyconnected.360Noadditionalconstraints. 5of8 CroatianOpenCompetitioninInformaticsRound4,January16th2021TaskJanjetina1.5seconds/512MiB/110points Example

7 sinput31123132output6 input41121232343ou
sinput31123132output6 input41121232343output6 input52122133342354output8Claricationofthethirdexample: 1 2 2 3 4 2 5 4 3 Thepairsare(1;3),(3;1),(1;5),(5;1),(3;5),(5;3),(4;5)and(5;4). 6of8 CroatianOpenCompetitioninInformaticsRound4,January16th2021TaskPatkiceII2seconds/512MiB/110points TaskPatkiceII AfterHolywoodgotitshandsonthefascinatingstoryofthesuccessfulumbrellavoyagebetweentwoislands,Netixexecutivesdecidedtomakeaseriesadaptationofthethreeducks'travels.AsyoumayrememberfromtherstroundofCOCI20/21,theduckshaveamapofoceancurrents.Theduckstraveltogether.Theislandwheretheducksliveismarkedbytheletter'o'.Theduckscanstarttheirvoyageinanyofthefourdirections.Oceancurrentsintheseseasmoveinoneofthefourdirections,andaremarkedinthefollowingway:west-east�'',east-west',north-south'v'andsouth-north'^'.Whentheducksarelocatedonacellwithacurrent,theywillmoveonecellinthedirectionofthecurrent.Calmseaismarkedbyadot'.'.Ifthecurrentsbringtheduckstoacellwithcalmsea,outsidethemap,orbacktothestartingisland,theywillstoptheirvoyage.Theislandthattheduckswanttovisitismarkedby'x'.Inordertomaketh

8 eseriesmoreappealing,Netixmadeafewc
eseriesmoreappealing,Netixmadeafewchangestothestory:theseanowmaycontainwildvortexes(theduckscangetstuckinacycle)andseacurrentsthatcarrytheducksoutsidethemap.*Therefore,theoriginalmapofcurrentshasbeenchanged.Butunderheavydeadlinepressure,thedirectorhasmadesomemistakes:theduckscannotarrivefromtheinitialtothetargetislandviaseacurrentsanymore.Netixdirectorsareveryimportantpersons,sotheydon'treallyspendtimecontemplatingplotholes.Thusitisyourtasknowtoreplaceasfewaspossiblecharactersonthemap,sothattheduckscangofromtheinitialtothetargetisland.Forstorypurposes,thecellswith('o'and'x')cannotbemodied.Allothercellsareeitherseacurrentsorcalmsea(characters�').Youcanreplacecharactersinthosecellswithcharactersfromthesameset�'.InputTherstlinecontainsintegersrands(3r;s2000),thenumberofrowsandcolumnsofthemap.Eachofthefollowingrlinescontainsscharactersfromtheset�'o,thatrepresentthemapofoceancurrents.Therewillalwaysbeexactlyonecharacter'o'andexactlyonecharacter'x'onthemap,andtheywillnotbeadjacent.OutputIntherstlineoutputk,theminimumnumberofchangessotha

9 ttheduckscangofromtheinitialtothetargeti
ttheduckscangofromtheinitialtothetargetisland.Intheeachofthenextrlines,outputscharacters,describingamapwhichdiersfromtheinputmapinexactlykcells,satisfyingtherequirementsoftheproblem.Iftherearemultiplevalidmaps,outputanyofthem. *Theducksalsoformaheartbreakinglovetriangle,butthatisnotimportantrightnow. 7of8 CroatianOpenCompetitioninInformaticsRound4,January16th2021TaskPatkiceII2seconds/512MiB/110points ScoringSubtaskPointsConstraints 1303r;s20280Noadditionalconstraints.Ifinalltestcasesinsomesubtakstherstline(minimumnumberofchanges)iscorrect,butthemapinsometestcaseisnotvalid,youwillgethalfofthepointsforthatsubtask.Examplesinput33�vo�vv��xoutput1�vo�vv�x input36��vv^ovvx^��^output2��vv&#x]TJ ;�.51; -1;.95; Td;&#x [00;&#x]TJ ;�.51; -1;.95; Td;&#x [00;^ox^��^ input44x.v.�..&#x]TJ ;&#x-0.5; -;.9;U T; [0;..^.ooutput4x&#x.]TJ;&#x 0.2;Y -;.9;U T; [0;.^&#x]TJ ;&#x-0.5; -;.9;U T; [0;..^