aboutsummaryrefslogtreecommitdiff
path: root/problems/55-D.txt
blob: 22ad1c3ff86b6a4a370e1c8f2133e9aefd9583ef (plain)
1
2
3
4
5
6
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�@�(�