Search found 8 matches

by harshahs
Mon Feb 23, 2004 1:39 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 28095

The problem is I am not familiar with C++. When next_permutation() STL can be implemented in a faster way, I think we can also do the same using C code. Can I get how the next_perumutation STL is implemented on the net? If you come across any such thing do help me to make my code more faster. Thank ...
by harshahs
Sat Feb 21, 2004 3:56 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 28095

Hello, I remove the for loop which i was using for output and instead used [c]printf("%s\n",&tstr[1]);[/c] This seems significantly faster, but still I am getting TLE on oj. I only know exponential algorithm for generating permutations. Is there any faster algorithm or can this code be still optimis...
by harshahs
Fri Feb 20, 2004 9:11 am
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 28095

I think that is what I am doing in the loop
while(i)
{
...
}

before that I am just sorting the string so that if the input is
baca
i will begin the loop with the string aabc.
by harshahs
Fri Feb 20, 2004 7:46 am
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 28095

Can you give me more hints on how to generate the string, without any computations.
by harshahs
Thu Feb 19, 2004 4:48 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 28095

how to speed up 195

hello, I am using Disjkastra's algorithm to generate the permutations of the given string in lexicographical ( dictonary ) order. But it is taking a lot of time when the string length exceeds 8. Can u guys help me in speeding up my program. [c] #include <stdio.h> #include <string.h> int main(void) {...
by harshahs
Fri Nov 28, 2003 1:04 pm
Forum: Volume 5 (500-599)
Topic: 516 - Prime Land
Replies: 23
Views: 6666

516 why TLE?

I am getting correct solution for all the input between 3 and INT_MAX, that too instantly, with this code for 516. why OJ is giving TLE? please help. [c] #include <stdio.h> #include <math.h> #include <string.h> unsigned stack[100]; int main(void) { char str[80]; unsigned register base,exp,i,val,temp...
by harshahs
Mon Oct 27, 2003 7:13 am
Forum: Algorithms
Topic: i am in need of urgent good help
Replies: 3
Views: 1622

Hello, Thanks for the reply. What I really meant was, I am able to get the algo for most of the problems. but my solution though correct lacks some severe optimization as a result my memory usage or time taken will be very high. I have been doing a lot of home work in this respect, both with web and...
by harshahs
Wed Oct 22, 2003 4:08 pm
Forum: Algorithms
Topic: i am in need of urgent good help
Replies: 3
Views: 1622

i am in need of urgent good help

Hello, I am new to this acm programming challenges. I have solved quite a few problems and all using conventional means and algorithms, which take a hell lot time to solve the given problem. My solutions are in no match with the time, people have taken to solve the problems. How do u people manage t...

Go to advanced search