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 ???
11855 - Buzzwords
Moderator: Board moderators
Re: 11855 - Buzzwords
>>>>>>>>> A2
Beliefs are not facts, believe what you need to believe;)
Beliefs are not facts, believe what you need to believe;)
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)
Then sort and it easy to find the answer! So the complexity is O(n*(n-1)/2)*logN or O(n^2logN)
Re: 11855 - Buzzwords
I just find a mistake in your code)))
look for your inner loop!!!!
look for your inner loop!!!!
Re: 11855 - Buzzwords
![:)](./images/smilies/icon_smile.gif)
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;)
Beliefs are not facts, believe what you need to believe;)
-
- Learning poster
- Posts: 71
- Joined: Thu Aug 21, 2003 1:56 am
Re: 11855 - Buzzwords
you can also use a suffix array/tree.
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.
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.
-
- 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!