ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1307. Архиватор

bitstream via C/C++
Послано SkorKNURE 26 окт 2008 20:04
I solved this problem with the Huffman encoding. It was not so complicated, but I wanna know how we can efficiently save out bitstream (1-0-encoded planetext) into the file?

1) I used only 7 bits from char and last (msb) bit always was '1' - because if we will use all 8 bits, we will get some  unprintable characters. How can we avoid this problem?

2) Also, did anybody think about using wchar_t for encode 16 bits in 1 character? Is it possible for our problem?

3) And last question. How can we store all char-encoded bitset in one string? I can't compile very long char sequences like

> const char *str = "asdjgagsd....asdgah";

with MSVC++. I have divided all char stream into

> char str[][10000] + {"ewfw..ewf","afe...",...};

Can we do it more efficiently?

Thanks :)

Edited by author 26.10.2008 20:06