|
|
back to boardWA #1 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/mtsVLZXBRe: WA #1 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 "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! |
|
|