»Ë»Ñ ÀåÅÍ

Àç´ÉÀåÅÍ ÀÔ´Ï´Ù.

  • ºÏ¸¶Å© ¾ÆÀÌÄÜ

°£´ÜÇÑ c++ÇÁ·Î±×·¡¹Ö µµ¿ÍÁֽǺÐ


  • ÁÖÀÇ 1) °Å·¡ Àü °¡ÀÔÀÚ ½Ç¸í°ú ÀåÅÍ È¸¿øÁ¤º¸, °èÁ¸íÀÌ °°ÀºÁö ¹Ýµå½Ã È®ÀÎÇϼ¼¿ä. 3ÀÚ »ç±â¿¡ À¯ÀÇÇØ ÁÖ¼¼¿ä.[CLICK]
  • 2) °í¾× °Å·¡¸¦ Çϰųª ¾ÆÀ̵𠵵¿ëÀÌ ÀÇ½ÉµÉ °æ¿ì, º»ÀÎÀÎÁõ ÀÌ·Â È®ÀÎÀ¸·Î ¾ÈÀüÇÏ°Ô °Å·¡Çϼ¼¿ä.[CLICK]
  • 3) ÀûÇÕ¼ºÆò°¡(KC, ÀüÀÚÆÄ ÀÎÁõ)¸¦ ¹ÞÁö ¾ÊÀº ÀüÀÚÁ¦Ç° µîÀ» ÆǸÅÇÏ´Â ÇàÀ§´Â ºÒ¹ýÀÔ´Ï´Ù.[CLICK]
  • ¾È³» ÀåÅÍ °Å·¡¿¡ ¾Õ¼­, ¾ÈÀüÇÏ°Ô °Å·¡ ÇÏ´Â ¹æ¹ýÀ» ²À È®ÀÎÇØÁÖ¼¼¿ä.
 °Å·¡Èñ¸Á°¡°Ý
30,000 ¿ø
 ÈÞ´ëÆù¿¬¶ôó
»èÁ¦(6°³¿ù °æ°ú)
°¡À帹ÀÌ ³ª¿Â ¹®ÀÚ¿­À» ã¾ÆÁÖ´Â ÇÁ·Î±×·¥ÀÔ´Ï´Ù.

²À Çؽ¬ÇÔ¼ö¸¦ »ç¿ëÇØ ±¸ÇöÇØ¾ß ÇÕ´Ï´Ù.

³»ÀϱîÁö ¿¬¶ôºÎŹµå¸³´Ï´Ù.

-> À§ ³»¿ëÀº 2014³â12¿ù01ÀÏ 20½Ã39ºÐ24ÃÊ¿¡ Ãß°¡µÇ¾ú½À´Ï´Ù.

Çؽ¬ÇÔ¼ö¸¦ ÀÌ¿ëÇؼ­ Æнº¿öµå¸¦ ¼­Ä¡ÇÏ´Â ÇÁ·Î±×·¥ÀÔ´Ï´Ù.

¿¹¸¦µé¾î
ÀÎDz : 3(»çÀÌÁî)  accacacea
¾Æ¿ôDz : cac

Length-3 substrings and their frequencies
accacacea  acc, cca, cac, aca, cac, ace, cea
acc: 1
cca: 1
cac: 2 <--°¡Àå ¸¹ÀÌ ³ª¿Â ¹®ÀÚ¿­<br /> aca: 1
ace: 1
cea: 1

Size of all length-15 strings
aaaaaaaaaaaaaaa ~ zzzzzzzzzzzzzzz
0 ~ 26^15–1 (= 1,677,259,342,285,725,925,375)


¾Æ·¡´Â ¿øº» ¹®Á¦ÀÔ´Ï´Ù.
A password with size N can be found by searching the text for the most frequent substring with N characters. After finding the password, the password can be used to decode the message.

Your mission has been simplified as you are only requested to write a program that, given the size of the password and the encoded message, determines the password following the strategy given above.

Input consists of two lines with the size of the password, 0 < N <= 15, followed by the text representing the encoded message whose size is less than or equal to 5,000,000. To simplify things, the input text only includes lower-case alphabet letters.<br />


Ricardo Lopes, CPUP'2003 Round 1
University of Porto local Contest

Å×½ºÆ® case ÷ºÎÇÏ¿© ¿Ã¸³´Ï´Ù.

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
ºÏ¸¶Å©¹öÆ° °øÀ¯¹öÆ°
÷ºÎÆÄÀÏ
  • ¾Ë¸² °¡°Ý ¾ð±Þ ÄÚ¸àÆ®¸¦ ±ÝÁöÇÕ´Ï´Ù. ºñ½Î¸é ¾È »ç½Ã¸é µË´Ï´Ù.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û