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

Обсуждение задачи 1414. Астрономическая база данных

WA #1
Послано Pavel Kovalenko 5 ноя 2010 00:43
I have WA #1. I checked following mistakes:
dots instead of spaces
sun in database
print 20 records
Also i cheсked following variants of actions:
Query "?" - print all records (or first 20) or print nothing.
Query "+" - add empty name into database or miss this query.
But any variant give me WA #1.
I use hash of all prefixes and store them in map.
Please help me. Simple problem, but there are some stupid bug. Offline my program passed all my tests.
My code:
http://pastebin.com/mtsVLZXB
Re: WA #1
Послано Sergey Lazarev (MSU Tashkent) 6 ноя 2010 18:51
Your program gives incorrect answer to test:

+ea
+e
?e

You don't add a new star if it's name is the prefix of other star's name which was added earlier.
And I'm not sure, but it seems you forgot about lexicographical order.

Edited by author 06.11.2010 18:52
Re: WA #1
Послано Pavel Kovalenko 6 ноя 2010 22:23
"You don't add a new star if it's name is the prefix of other star's name which was added earlier."

Thank you very much!