<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Tiago Peczenyj, Apos contar o numero de letras "H-A-C-K-E-R-C-U-P" na linha voce vai ter algo como,<div><br></div><div>H -> 54,</div><div>A -> 100,</div><div>C -> 30 / 2 (15), #pois o C repete</div><div>K -> ...</div><div><br></div><div>Apos voce ter um hash com os valores, voce deve pegar o de valor mais baixo pois com o valor mais baixo 'e o numero de vezes que voce consegue escrever a palavra.</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-- <br>Software Engineer<br>Just Another Perl Hacker<br>Daniel Mantovani +5511 8538-9897<br>XOXO</div></span></div></span></span>
</div>
<br><div><div>On Jan 30, 2012, at 12:00 AM, Tiago Peczenyj wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>sim, mas o que causa a diferença? não entendi pq vc usa um sort...<br>acho q eu não entendi o problema :/<br><br>2012/1/29 Daniel Mantovani <<a href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</a>>:<br><blockquote type="cite"> Tiago Peczenyj, eu coloquei um diff dos resultados no seu facebook.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite">Software Engineer<br></blockquote><blockquote type="cite">Just Another Perl Hacker<br></blockquote><blockquote type="cite">Daniel Mantovani +5511 8538-9897<br></blockquote><blockquote type="cite">XOXO<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Jan 29, 2012, at 11:31 PM, Tiago Peczenyj wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Mantovani<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Eu to com preguiça mas... qual foi o meu erro?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">dá um help ae<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">2012/1/29 Daniel Mantovani <<a href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</a>>:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Agora que a fase um ja terminou, podemos brincar com os problemas.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">O Wesley Seidel, me chamou hoje no Google Talk e comentou sobre os<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">problemas. Ele me mandou os problemas e me pareceram bem legais, eu parei<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">para mexer em apenas um deles hoje:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Alphabet Soup<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Alfredo Spaghetti really likes soup, especially when it contains alphabet<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">pasta. Every day he constructs a sentence from letters, places the letters<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">into a bowl of broth and enjoys delicious alphabet soup.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Today, after constructing the sentence, Alfredo remembered that the Facebook<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Hacker Cup starts today! Thus, he decided to construct the phrase<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">"HACKERCUP". As he already added the letters to the broth, he is stuck with<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">the letters he originally selected. Help Alfredo determine how many times he<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">can place the word "HACKERCUP" side-by-side using the letters in his soup.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Input<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The first line of the input file contains a single integer T: the number of<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">test cases. T lines follow, each representing a single test case with a<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">sequence of upper-case letters and spaces: the original sentence Alfredo<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">constructed.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Output<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Output T lines, one for each test case. For each case, output "Case #t: n",<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">where t is the test case number (starting from 1) and n is the number of<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">times the word "HACKERCUP" can be placed side-by-side using the letters from<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">the sentence.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Constraints<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">1 < T ≤ 20<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Sentences contain only the upper-case letters A-Z and the space character<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Each sentence contains at least one letter, and contains at most 1000<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">characters, including spaces<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Eu anexei o input "alphabet_soup.txt" ,a saida "certo.txt" e o meu script<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">"script.pl".<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Software Engineer<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Just Another Perl Hacker<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Daniel Mantovani +5511 8538-9897<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">XOXO<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">=begin disclaimer<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">  Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/">http://sao-paulo.pm.org/</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">=end disclaimer<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite">Tiago B. Peczenyj<br></blockquote><blockquote type="cite">Linux User #405772<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="http://pacman.blog.br">http://pacman.blog.br</a><br></blockquote><blockquote type="cite">=begin disclaimer<br></blockquote><blockquote type="cite">  Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/">http://sao-paulo.pm.org/</a><br></blockquote><blockquote type="cite">SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br></blockquote><blockquote type="cite">L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br></blockquote><blockquote type="cite">=end disclaimer<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">=begin disclaimer<br></blockquote><blockquote type="cite">  Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/">http://sao-paulo.pm.org/</a><br></blockquote><blockquote type="cite"> SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br></blockquote><blockquote type="cite"> L<<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>><br></blockquote><blockquote type="cite">=end disclaimer<br></blockquote><blockquote type="cite"><br></blockquote><br><br><br>-- <br>Tiago B. Peczenyj<br>Linux User #405772<br><br><a href="http://pacman.blog.br">http://pacman.blog.br</a><br>=begin disclaimer<br>   Sao Paulo Perl Mongers: http://sao-paulo.pm.org/<br> SaoPaulo-pm mailing list: SaoPaulo-pm@pm.org<br> L<http://mail.pm.org/mailman/listinfo/saopaulo-pm><br>=end disclaimer<br></div></blockquote></div><br></div></body></html>