• 22-01-2021, 11:52:59
    #1
    Alıntı
    Petya is developing a software component for encoding text files. He knows that the texts he has to record can contain a specific set of symbols: lowercase and uppercase Latin letters (there are 26 letters in the Latin alphabet), lowercase and uppercase Russian letters (there are 33 letters in the Russian alphabet), digits from 0 to 9, as well punctuation marks and special symbols, of which there are 20 in total. First, Petya decided to encode the codes of symbols using a minimal number of bits that is the same for all symbols. Vasya noted that the texts that Petya is encoding can be split into two nonintersecting segments: abstract and main text. Furthermore, when encoding an abstract, you only use lowercase and uppercase Latin letters, digits from 0 to 9, and ten punctuation marks. He suggested that Petya use different code pages for abstracts and main texts, and encode abstracts using codes of symbols that use a minimal number of bits that is the same for all symbols used in an abstract, and encode main texts using codes of symbols that use a minimal number of bits that is the same for all symbols used in a main text. Petya tried applying this method with a file in which the number of symbols in the abstract amounts to 1/8 of the number of symbols in the whole of the text, and got a benefit of 1024 bits when encoding the file in comparison with his initial method. Find the number of symbols in the text Petya is encoding. The answer should be an integer.

    Note: no other data is encoded apart from the codes of symbols specified in the task's conditions, and the file is not compressed.
    Selamlar,
    Çözümü anlatabilecek olan var mıdır aranızda?
  • 22-01-2021, 11:54:39
    #2
  • 22-01-2021, 12:23:32
    #3
    Benim anladığım kadarıyla şimdi metin de bir özet kısmı ve asıl ana metin kısmı var.İlk kodlama yönteminde direk hepsini bir harmanlıyor hesaplarıma göre karakter başı 1 byte gidiyor.2. Yöntemdekarakter başı 7 bit gidiyor
    Elimizde bir metin var, özet kısmı ana metinin 1/8 i kadar.İlk method ile kodlayınca boyut - 2. method ile kodlayınca = 1024 bit
    tüm metindeki toplam karakter sayısı?

    özet 1x metin 8x
    9x toplam karakter sayısı


    1. METHOD
    9x * 8 = 72x = ilk method toplam bit sayısı
    2. METHOD
    özet:x * 7 = 7xmetin:8x * 8 = 6464x + 7 = 71x ikinci method toplam bit sayısı
    x = 1024

    x * 9 = 9216 toplam karakter sayısı

    Yanlış yapmadıysam 9216 olmalı.