diff options
author | Anthony Wang | 2020-05-30 23:37:44 +0000 |
---|---|---|
committer | repl.it user | 2020-05-30 23:37:44 +0000 |
commit | 6310ca3384464081ec781d1ecd308149333d40a8 (patch) | |
tree | d6d3c412c0e00b624cd6dad65829101ba549dd29 | |
parent | d8881d65c35e628e4ad380781dfde838fca0be3b (diff) |
-rw-r--r-- | problems/55-D.txt | 7 | ||||
-rw-r--r-- | problems/55-H.txt | 9 | ||||
-rw-r--r-- | problems/D.out | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/problems/55-D.txt b/problems/55-D.txt new file mode 100644 index 0000000..22ad1c3 --- /dev/null +++ b/problems/55-D.txt @@ -0,0 +1,7 @@ +smmr is clsng in,you have set your eyes on a smmr ntrnshp with your fvrt fruit cnfdrcy,ctrs.what you rlly want is to take over ntr rgnstn on your way to world fruit dmntn,but gttng an ntrnshp is a nice first step.you know that there is a sngl prsn in ctrs dcdng who gets ntrnshp,but nfrtntly,you dont know who that prsn is.thus,you dcd to nfltrt ntr rgnztn by brbng some sbst of mmbrs,so that you are grntd to get ntrnshp.you have lrdy gthrd rgnztn map,as well as stmtd mnt of money each mmbr would rqr to aid your cnddcy.only thing rmnng is dcdng who to rcrt.when you bribe a ctrs mmbr,that mmbr will be able to mnplt both their sprr as well as their drct sbrdnts to spprt your cnddcy.in this way it is not ncssry to bribe vryn in ctrs,as long as vryn in rgnstn is thr brbd or mnpltd by smn who is.in ddtn,you want to take an extra prctn.you do not want two dffrnt ppl to both be brbd if they ever talk to each other,then they might rlz what your final plan is,start blckmlng you.ctrs prtcl dctts that nbdy shld ever dscss nythng with nyn who is not their mmdt boss or sbrdnt,so you fgr your schm will be sffcntly safe as long as you avoid brbng mmdt sprr of smn else you bribe.to ntt nfltrtn you are to write a prgrm that given rgnztnl map of ctrs as well as cost of rcrtng each of its mmbrs,tpts mnmm mnt of money rqrd to cmplt task.bcs ctrs is so wll-rgnzd,every mmbr has xctly one mmdt sprvsr,xcpt one,only most sour xcllnc,who has only sbrdnts.ipf first line cnssts of an ntgr 1<=n<=100000,nmbr of mmbrs in ctrs.then fllws n lines,each dscrbng a mmbr,bgnnng with mmbr 0,ndng with mmbr n1.line dscrbng mmbr i bgns with two ntgrs 0<=c_<=1000000,0<=_<n,cost of rcrtng mmbr i,nmbr of mmdt sbrdnts of mmbr i rspctvly.then fllws u_i nmbrs on same line,dntfctn nmbrs of sbrdnts.note that all dntfctn nmbrs are btwn 0,n1.opf mnmm cost of nfltrtng ntr rgnztn while dhrng to rstrctns above.bsrv that nswr might very well be lrgr than 2^32.spi 8 2 2 1 2 4 0 3 0 20 1 6 20 1 3 3 2 0 4 5 1 7 1 0 spo 15 +Original length: 2250 +Compressed length: 1012 +Percent compression: 55.0222% +T�;�5|t�OW�z۫�~�6~�:|yyu�w7�5�sս�6�Z?�=kZ�M�1��P�`K��P�4U�@�B�5�Y�$͜�c�z翵2�u<&[% �b*{�+�*�^�-�(I�(N�܉?�K�n_ʲ���2�#�% �V&Ζ�l� +�o�X�_�2Y��5
�;�ee(I�e�o+�Ζ�X|<�&a(I� ;�c�w��ݾ�J�8df�a�p�JJW�9�^oX�$�T%�x�O�QL�S͙č�{�̐�Z�e�L�xsB�?J�F�k�͊�~_z�LV8�u�c�uQ�ڻJA_c�6Ζc�L>g\�\9a�'g9[}f7%�jΔ�l��^pB�fJ�F�k�YLE���#Zq�k�*�V�_�u%Ȳ/%H�Z�->8۸v?Ҍ5�8E�e�_�P�0�=N�R�`�}(I�c*{�$�{�f�'gq�Ϝ�͕�j�9[�8[�U1�k�_�l9�$�d�\F\�e�m�}Q�<�u`�̯�X�+�柚�:�Ug�e�gY�LV�q�f�p�4�3BP�0� m�W�y�{Ye� ˾�@IBI�q�e���% ��-JJWN�_�`�ۃ�x}�.�(&2�L5gJ�%�iݷ/�h��pƙ��٪� z��N�:�AS�~��5�i�e�le��S�FZm�Ր͊!q�$MZ�jc�-�lV�/ޜ�}Ǒ�V�F\ 3e�{�ϯ�|;\#3c��q�.s�S�d�5�Z��n_ +c�6ܻ�/�?��y�2�k�V�e�xܻ�r�v�A�|>�뇏�%�iݷ/c�;\#3c�G���5�S_*�ٺ�9OA�g�@�(� diff --git a/problems/55-H.txt b/problems/55-H.txt new file mode 100644 index 0000000..d9f89c2 --- /dev/null +++ b/problems/55-H.txt @@ -0,0 +1,9 @@ +logo is an old prgrmmng lngg with a trtl that holds a pen.cmmnds in lngg allow trtl to move in drctn he is pstnd.if pen is down,then a line is drawn in his path of mvmnt.ucf prgrmmng team has dcdd that it wants to rsrrct logo,mrkt new tool to mddl schls in hope of nsprng next wave of ucf prgrmmng team chmpns.in nwlg,trtl draws on a grid,20 chrctrs high,30 chrctrs wide with top left crnr with crdnts,0,0,bttm right crnr with crdnts,19,29.each grid sqr will cntn a sngl text chrctr.at bgnnng of any nwlg prgrm,grid cntns all blank sqrs,trtl is lctd at,0,0,hdd right with his pen down.in ddtn to being able to put his pen up,down,trtl can chng chrctr with which his pen draws,his strtng chrctr is '*'.this will allow dsply to have more vrty than bfr.fnlly,trtl can turn right or left in ncrmnts of 45 dgrs,so it is pssbl to move dgnlly.here are nwlg cmmnds,start pen up pen down chng chrctr C move X right turn R left turn L end start cmmnd smply ndcts start of a nwlg prgrm while end cmmnd ndcts end of a nwlg prgrm.both pen cmmnds do not move trtl at all,but smply chng state of trtls pen to thr up,not wrtng,or down,wrtng,as ndctd.chng chrctr cmmnd does not move trtl at all or draw nythng.it smply chngs chrctr with which pen will draw,if it is down,on sbsqnt cmmnds after this cmmnd is xctd.move cmmnd smply moves trtl from its crrnt spot X nmbr of steps.if pen is down,then this chrctr is drawn in each grid sqr on path.only sqr for which this isnt ncssrly true is ntl sqr of path.if this ntl sqr was prvsly drawn on,then we dont draw over it with ptntlly new chrctr.if this ntl sqr was prvsly blank,then we do draw over sqr with new chrctr.thus,if first line after start in a prgrm is move 5,then 6 stars are drawn.hwvr,if this is fllwd by move 3,only 3 more stars will be drawn.right turn,left turn cmmnds turns trtl,in place,R dgrs to right or L dgrs to left,rspctvly,R,L are given in mltpls of 45 dgrs.if a nwlg prgrm cmmnds trtl to go off 20 x 30 grid,prgrm has csd a trtl out of bnds error.prblm,for each nwlg prgrm,prdc opt of prgrm.you are grntd that these prgrms are syntctclly crrct.nmly,only cmmnds lstd above will be used,ngls for turns will be pstv ntgrs that are mltpls of 45,vls for mvmnt will be pstv ntgrs,chrctr for chng chrctr cmmnd will lwys be a nn-whtspc prntbl chrctr,these are chrctrs with ascii vls in btwn 33,126,nclsv.if prgrm prdcs a trtl out of bnds error,then smply dsply this error mssg nstd.ipf first line of ipt file will cntn a sngl pstv ntgr,n,n<=100,dsgntng nmbr of nwlg prgrms your prgrm will have to ntrprt.all of prgrms fllw,with one cmmnd per line.you are grntd that first line of each prgrm is cmmnd start,that last line of each prgrm is cmmnd end.on each line of code,all words,nmbrs will be sprtd by a sngl space from each other.no extra spcs will be ncldd at bgnnng or end of any lines.opf first line of opt for each prgrm shld have fllwng frmt,prgrm #k where k rprsnts prgrm nmbr,strtng at 1.if there is no error in prgrm,then opt ntr grid.in order for opt of a prgrm to be ccrt,there must be spcs,not tabs or other chrctrs,in each spot where no opt was wrttn drng crs of prgrm.in ddtn,place grid nsd of a rctngl of +,-,| chrctrs where - makes up hrzntl line,| makes up vrtcl line,+ rprsnts crnrs,see spo.each grid will be opt as 22 lines of 32 chrctrs each,which is 20 by 30 grid srrndd by rctngl.if there is a trtl out of bnds error in prgrm,smply dntfy line nmbr of first time error ccrs,opt a sngl line with fllwng frmt,line x,trtl out of bnds error where x rprsnts line nmbr of first line of code in prgrm that css a trtl out of bnds error.start line is line nmbr 0.all sbsqnt lines are nmbrd in rglr cntng order.skip a blank line in btwn opt for each prgrm.spi 2 start move 5 right turn 90 chng chrctr & move 4 right turn 45 chng chrctr @ move 3 end start move 25 right turn 90 move 5 left turn 90 move 6 right turn 45 end spo prgrm #1 +------------------------------+ |****** | | & | | & | | & | | & | | @ | | @ | | @ | | | | | | | | | | | | | | | | | | | | | | | | | +------------------------------+ prgrm #2 line 5,trtl out of bnds error +Original length: 4396 +Compressed length: 1978 +Percent compression: 55.0045% +T5yrUգm\Zu5_اs϶Oծئ][vzynf_~,rzp.z%4<Q>2;7?LNg*R;h^ȟLŞ;.?
w22p.|gBY?xJPl.>s57}Σڇ#?"Un;mPjk4XL$g~
riIJW)Ӕ3lUi?BW7{v!ypnNSܳqmc:uC,=bv4NX6B#4~f`vZbv*=&:vuT^lKyp4gTOs4k;g>}զLE*{zCKb=pe*'víCvbTjF.S{U*ǟԷ+t x*Co?bHNS53ɸ>[9aꠇLE>SXUF''gާA;l#Rȟs'!?5f)MW7q8Ov&zUH[ۜ@ .}~ZiI[i9AY?OOi{S#4A6KCEo?E]4v,9imG!DbW4?Mx
7Yf4U%^مX?{
0/f3{N&zV WTivOOz*SJo?=JFijLzq9_h^ȟLŞ;.?2X62NfC,D.]eBL& +T:v92t͋.S~ܺ +vÝؓps= ; +ob;]бu}'솛S]م7lu0/ڼp_63 5뙊?ϸOE;c79*w}ye*S-bW6G;r?vÝ4]nOtuS7D8֬҇4gqkVW2vU1)8Y͋@ 'zVG\qJmgN;5)Aj Ts!Uّ\:356rds.ʩc6%4]~J؏Vc*أ2|im ⧪ir=CH:f. S΅qC)Y|gs?RNYbuX^i{@{V->b;t ecr.sRLľڵ1;:d|Zf=rmT8\i{vU*_.SgԶ)/ڼs1es{$iRN!ZyjӐ^\E W*5{P!{(ǹk+{p.D"fQT 1mk6o\rzOvmϹ!L%zvtbx{gUGE4!~=bt;wP{%4LY~ZE +oё\mϹ8C,5,%?{w=5q&wlEYOzq4fѼ3<ݳDY?tɑMbvLڿ\g99f=}?1n]~|U2ꐧ *g9]^fC,<]~pdsn*BY?|!~NK\6vǹp0@,{P+UIZ~Wv|pl%n?*X0;-|sdy3r.j'w0Έj;cvZt7EӼѼ3@o?N9bZe&rA|lUsqզݳĸ:4 diff --git a/problems/D.out b/problems/D.out new file mode 100644 index 0000000..933c597 --- /dev/null +++ b/problems/D.out @@ -0,0 +1 @@ +summer is closing in,you have set your eyes on a summer internship with your fvrt fruit cnfdrcy,ctrs.what you really want is to take over ntr rgnstn on your way to world fruit dmntn,but gttng an internship is a nice first step.you know that there is a sngl prsn in ctrs dcdng who gets ntrnshp,but nfrtntly,you dont know who that prsn is.thus,you dcd to nfltrt ntr rgnztn by brbng some sbst of members,so that you are grntd to get internship.you have already gathred organization map,as well as stmtd mnt of money each member would rqr to aid your cnddcy.only thing remaining is deciding who to recruit.when you bribe a ctrs member,that member will be able to mnplt both their sprr as well as their drct sbrdnts to spprt your cnddcy.in this way it is not ncssry to bribe vryn in ctrs,as long as vryn in rgnstn is thr brbd or mnpltd by smn who is.in ddtn,you want to take an extra prctn.you do not want two dffrnt ppl to both be bribed if they ever talk to each other,then they might rlz what your final plan is,start blckmlng you.ctrs prtcl dctts that nbdy shld ever dscss nythng with nyn who is not their mmdt boss or sbrdnt,so you fgr your schm will be sffcntly safe as long as you avoid brbng mmdt sprr of smn else you bribe.to ntt nfltrtn you are to write a prgrm that given organizational map of ctrs as well as cost of rcrtng each of its members,tpts mnmm mnt of money rqrd to cmplt task.bcs ctrs is so wll-rgnzd,every member has xctly one mmdt sprvsr,xcpt one,only most sour xcllnc,who has only sbrdnts.ipf first line cnssts of an ntgr 1<=n<=100000,number of members in ctrs.then fllws n lines,each dscrbng a member,bgnnng with member 0,ndng with member n1.line dscrbng member i bgns with two ntgrs 0<=c_<=1000000,0<=_<n,cost of rcrtng member i,number of mmdt sbrdnts of member i rspctvly.then fllws u_i numbers on same line,dntfctn numbers of sbrdnts.note that all dntfctn numbers are btwn 0,n1.opf mnmm cost of nfltrtng ntr rgnztn while dhrng to rstrctns above.bsrv that nswr might very well be lrgr than 2^32.spi 8 2 2 1 2 4 0 3 0 20 1 6 20 1 3 3 2 0 4 5 1 7 1 0 spo 15
\ No newline at end of file |