Search trends

Discuss about the puzzles, but without giving the solutions please !!!

Search trends

Postby admin » Mon Jan 10, 2011 8:21 am

Nowadays, every website reports their trends, or buzzwords, etc... which basically are the most frequent search requests, or post title names. The goal of this puzzle is to write a trend search which takes a list of a search requests, processes it, and returns the most frequent ones in decreasing order of popularity.


Last edited by admin on Mon Jan 17, 2011 11:29 pm, edited 3 times in total.
Reason: Edit
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Search trends

Postby vladut » Mon Jan 17, 2011 4:16 pm

the input file? is it given as argument?
User avatar
vladut
 
Posts: 12
Joined: Sun Jan 16, 2011 9:53 pm

Re: Search trends

Postby admin » Mon Jan 17, 2011 5:00 pm

Yes the filename is passed to argv[1].
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Search trends

Postby st0le » Mon Jan 17, 2011 11:16 pm

What if two have same frequency? whats the order i should follow?
return 0;
User avatar
st0le
 
Posts: 24
Joined: Sun Jan 16, 2011 11:56 pm

Re: Search trends

Postby davidb » Mon Jan 17, 2011 11:27 pm

You should use the alphanumerical order on the terms, I'll update the puzzle description.
User avatar
davidb
 
Posts: 24
Joined: Thu Dec 23, 2010 1:55 am

Re: Search trends

Postby st0le » Tue Jan 18, 2011 1:52 am

It's weird.

"Your program didn't pass the test case given in the puzzle example".

I did "verify" and it passed successfully...Something i'm missing?
return 0;
User avatar
st0le
 
Posts: 24
Joined: Sun Jan 16, 2011 11:56 pm

Re: Search trends

Postby admin » Tue Jan 18, 2011 2:13 am

St0le, earlier today (several hours ago) I fixed a bug in AJAX that was filtering out the "\" in "\n".

I suspect your browser cache is still using the old javascript.
Can you clear your cache in your browser ?
Or try in a different web browser ?

Contact me through private message if the problem persists, I'll direct you to debug it further.
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Re: Search trends

Postby st0le » Tue Jan 18, 2011 3:46 am

You were right, the website is stripping off the '\' from '\n'....

I've cleared my cache, and tried a different browser, the problem still persists.

Is there something i should be doing?
return 0;
User avatar
st0le
 
Posts: 24
Joined: Sun Jan 16, 2011 11:56 pm

Re: Search trends

Postby stefanie » Tue Jan 18, 2011 7:56 am

I improved my code from
1,06735246419 sec to 7,21777376755e-07 sec for 5000 lines and still get the same score :?

Is this normal? Do I have to improve something else?

Stefanie
User avatar
stefanie
 
Posts: 4
Joined: Tue Jan 18, 2011 5:27 am

Re: Search trends

Postby admin » Tue Jan 18, 2011 5:51 pm

stefanie, what counts is the sum of the times for all the tests.

The equation we use is this:
q = (cpulimit-cpu)/float(cpulimit)
Then that number q is rounded to the nearest 100th.

That number q is then multiplied by the number of points assigned to the puzzle being solved, and the resulting number is the score assigned to the solution.
User avatar
admin
Site Admin
 
Posts: 333
Joined: Thu Dec 23, 2010 1:27 am

Next

Return to Puzzles

Who is online

Users browsing this forum: No registered users and 3 guests

cron