|
|
how i may get end entering command (i writen on C) Edited by author 19.11.2006 02:29 +a1 +a2 ... +a5000 ?a ?a ?a and 5000 queries ?a or this operations in random order IMHO O(N^2) - is best. I am right? I try to solve this with red&blak tries but WA#5 what's in this test? I had WA#5 when my program gives more then 20 names of stars. How can I get where's the end of commands? There are no files and eof() in pascal won't help. - Thanx, but now I have another problem: WA #5. I'm adding all the stars, was it in the base or not. Then on a query I create a new array with stars matching the mask, but not in this array already. Then quicksort this array and output. Maybe my algorythm is wrong and I should enter all the stars first, sort them and then output. This may work because only 20 first stars should be printed. What can you say? And sorry for my bad english :) Your algo seems to be correct. I Write Simple Algo But WA 5 too... I do add the word "sun" in my base - I would be very gratefull, here's my email: zorg-n-ko@nm.ru Here is my source: version #1 [code deleted] version #2 [code deleted] Edited by author 10.12.2005 16:02 Edited by moderator 22.02.2006 22:07 You shouldn't print points) And write a directive {$IFNDEF ONLINE_JUDGE} (not JUDJE but JUDGE) correctly. What is the answer for this test: +e1 +e2 +e10 ?e Only sort array and use binary search... Who can help??? How you passed first test? use sort and binary search would timelimit at #11 my code: [code deleted] Edited by moderator 22.02.2006 22:05 how about trie tree? (mle) use sort and binary search would timelimit at #11 Why tle11? Its only: n log n You try to use other sort procedure(not qsort)? Maybe in 11 test qsort works n*n(unreal?)... First I have WA1 but then I found my mistake... Check this- +aaaa +a ?a Right answer is: a a aaaa My program gives right answer for this test! Try this test: +eee +eef +eed ?e answer: e eed eee eef Try this test: +eee +eef +eed ?e answer: e eed eee eef My program get right answer for this test... I dont understand whats wrong... Sorry for post code but i cant find mistake... Maybe you can??? [code deleted] Edited by moderator 22.02.2006 22:08 Please give me some test becouse I always have WA#1! I don't print dots, only spaces! don't shout loudly and show your impatience. case 1 is frequently similar or exactly the same as sample input. check it carefully, esp. the format. what's more, you should check if you have put the word "sun" inside your words list. Of course I remember about the word "sun". But inspite of it I can't find my mistake! Am I right that (e10<e2)? I just used strcmp in C/C++. Besides, i really met no trick.. I got AC directly/firstly during the contest I use strcmp too and I can't understand why WA#1. [code deleted] Edited by moderator 08.11.2005 00:06 You output only one space, but in description: "Each name must be preceded by two spaces as it is shown in the sample" Edited by author 05.11.2005 04:28 I print two spaces, but they aren't shown in this page! It is really strange! I tested your code on simple tests with my prg and all outputs are equal... You need help of author... Your solution outputs last query twice! Try this while(cin>>c>>s){ instead of while(!cin.eof()){ cin>>c>>s; Thank You!!! You were right!!! Edited by author 08.11.2005 16:43 [CODE WAS HERE] Edited by author 30.10.2005 14:44 It is terrible bug. Now I havn't it. |
|
|