## 11855 - Buzzwords

All about problems in Volume 118. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Angeh
Experienced poster
Posts: 108
Joined: Sat Aug 08, 2009 2:53 pm

### Re: 11855 - Buzzwords

Then what do you do with This Array ?
sort and unify and then Count ???
i wonder why your time is so good ...
would you please Explain more ....

1- you try all N*(N-1) strings and make a hashCode FOR each sub string ...
2- make an aray of pair <hashCode ,Counter >
3- sort the Araay ....
4- combine all similar hashcodes and Count them ...
5- save and out put ...

is this what you do ???
>>>>>>>>> A2
Beliefs are not facts, believe what you need to believe;)

Igor9669
Learning poster
Posts: 85
Joined: Sun Jun 08, 2008 12:58 pm

### Re: 11855 - Buzzwords

not a counter, I use it for the lenght of the string which make this hash!
Then sort and it easy to find the answer! So the complexity is O(n*(n-1)/2)*logN or O(n^2logN)

Igor9669
Learning poster
Posts: 85
Joined: Sun Jun 08, 2008 12:58 pm

### Re: 11855 - Buzzwords

I just find a mistake in your code)))
look for your inner loop!!!!

Angeh
Experienced poster
Posts: 108
Joined: Sat Aug 08, 2009 2:53 pm

### Re: 11855 - Buzzwords

)
now i get it ... Nice ...
got AC in 0. 464 -- used int instead of long long ...
but i still believe that some test Case would break this solution ...
Thanks for your help Igor ...
>>>>>>>>> A2
Beliefs are not facts, believe what you need to believe;)

howardcheng
Learning poster
Posts: 71
Joined: Thu Aug 21, 2003 1:56 am

### Re: 11855 - Buzzwords

you can also use a suffix array/tree.

DJWS
Learning poster
Posts: 100
Joined: Sat Oct 11, 2003 3:30 pm
Location: Taiwan
Contact:

### 11855 sample output is incorrect

In the problem statement,
the sample output of the first test case is:

5
4
4
2
2

It should be

4
3
3
2
2

My program passed all cases from the judge.
So I think it's just a typo in the problem statement.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 11855 sample output is incorrect

No, the problem statement is correct. T occurs 5 times.
Check input and AC output for thousands of problems on uDebug!