WORD w[100000];
why is that array only 100000 big ?
It's not neccesary to check out anymore !!!! Your observation is correct and exact, thanks !!!!!
I increased length of array to 400000, and it was accepted :D.
I didn't expect to have any wrong answer, because of using less memory than ...
Search found 15 matches
- Wed Nov 23, 2005 8:38 am
- Forum: Volume 109 (10900-10999)
- Topic: 10975 - Dueue's Quiz
- Replies: 39
- Views: 23559
- Tue Nov 15, 2005 5:59 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10975 - Dueue's Quiz
- Replies: 39
- Views: 23559
- Mon Nov 14, 2005 9:50 am
- Forum: Volume 109 (10900-10999)
- Topic: 10975 - Dueue's Quiz
- Replies: 39
- Views: 23559
- Sat Nov 12, 2005 6:43 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10975 - Dueue's Quiz
- Replies: 39
- Views: 23559
10975 - Dueue's Quiz
Is there any special trick for this problem ???
What should be the correct answer for this input
Sample Input
What should be the correct answer for this input
Sample Input
My Output1
4
a
a
bb
bbb
3
3 3
aaa
aaa
aaa
3 3
bbb
bbb
bbb
3 3
ccc
ccc
ccc
Any commenting or suggesting will be pleasedTest Case #1
Query #1
a 9
a 9
Query #2
bb 40
bbb 16
Query #3

- Sat Nov 12, 2005 5:18 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10973 - Triangle Counting
- Replies: 31
- Views: 19042
Your assumption that the number of edges in such a graph is less than 3*V is wrong
I have to accept you are allright. Very nice sample. When i solved this problem, i was thinking what was the worst case for number of triangules :D. Well, at least my algo runs on time. I didn't expect such a case ...
I have to accept you are allright. Very nice sample. When i solved this problem, i was thinking what was the worst case for number of triangules :D. Well, at least my algo runs on time. I didn't expect such a case ...
- Sat Nov 12, 2005 8:51 am
- Forum: Volume 109 (10900-10999)
- Topic: 10973 - Triangle Counting
- Replies: 31
- Views: 19042
- Thu Jun 02, 2005 9:43 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10862 - Connect the Cable Wires
- Replies: 14
- Views: 11014
- Tue Mar 22, 2005 8:49 am
- Forum: Volume 108 (10800-10899)
- Topic: 10825 - Anagram and Multiplication
- Replies: 18
- Views: 10083
- Tue Mar 15, 2005 4:02 am
- Forum: Volume 108 (10800-10899)
- Topic: 10825 - Anagram and Multiplication
- Replies: 18
- Views: 10083
- Sat Mar 12, 2005 9:07 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10829 - L-Gap Substrings
- Replies: 14
- Views: 12293
- Tue Mar 08, 2005 2:20 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10827 - Maximum sum on a torus
- Replies: 52
- Views: 36662
- Tue Mar 08, 2005 12:33 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10829 - L-Gap Substrings
- Replies: 14
- Views: 12293
10829 - L-Gap Substrings
Any hint for solving this problem ??
In the worst case (a string with 50,000 same character), the solution is greater than 500,000,000 L-GAP. O.K. We can manage that case.
I think, even using KMP's algrithm is not possible count all L-GAPs in time
Please, help.
In the worst case (a string with 50,000 same character), the solution is greater than 500,000,000 L-GAP. O.K. We can manage that case.
I think, even using KMP's algrithm is not possible count all L-GAPs in time
Please, help.
- Wed Feb 09, 2005 7:50 am
- Forum: Volume 108 (10800-10899)
- Topic: 10810 - Ultra-QuickSort
- Replies: 36
- Views: 27671
- Tue Feb 08, 2005 12:44 am
- Forum: Volume 108 (10800-10899)
- Topic: 10810 - Ultra-QuickSort
- Replies: 36
- Views: 27671
I'm not sure if your algorithm is fast. In order to count the minimun number of swaps, you should use a 64-bit integer, because of in the worst case [ 500000, 499999, 499998, .... , 1 ] you need (500,000) * (499,999) / 2 swaps and that number doesn't fit into a 32-bit integer.
My implementation use ...
My implementation use ...
- Tue May 25, 2004 9:14 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10603 - Fill
- Replies: 19
- Views: 13324