Re: [algogeeks] Re: Segmentation fault

2011-06-24 Thread rizwan hudda
Saurabh: Your Circular list approach will not run in the time constraints for this problem. Try solving it on SPOJ. On Fri, Jun 24, 2011 at 10:50 AM, saurabh singh wrote: > > @anonymous populate the array first.Use bottom up approach rather than > top down approach. > > -- > You received th

Re: [algogeeks] Re: Segmentation fault

2011-06-23 Thread saurabh singh
@anonymous populate the array first.Use bottom up approach rather than top down approach. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, sen

[algogeeks] Re: Segmentation fault

2011-06-23 Thread anonymous procrastination
@kartik Still getting SIGSEGV :( Also " a[106]={0};" only works at the time of declaration. I can't use it in the middle of the program. Please correct me if I'm wrong. On Jun 23, 11:43 pm, kartik sachan wrote: > @anoyomous take array size as a[106] > > and dude to intilize array to zer

[algogeeks] Re: Segmentation fault

2011-06-23 Thread anonymous procrastination
Forgot to mention that I'm getting SIGSEV On Jun 23, 10:32 pm, anonymous procrastination wrote: > Hello, > > I tried the question using single array. > Condition on n,d given is 100. So array size goes the same right? > > #include > #include > > int f(int n,int d); > int dp[100]; > int ma

Re: [algogeeks] Re: Segmentation fault

2011-06-23 Thread kartik sachan
@anoyomous take array size as a[106] and dude to intilize array to zero u si,ply write a[106]={0}; -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from t

Re: [algogeeks] Re: Segmentation fault

2011-06-23 Thread kartik sachan
@saurabh circular link list implementation i think tough as camparision to single array -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send emai

[algogeeks] Re: Segmentation fault

2011-06-23 Thread anonymous procrastination
Hello, I tried the question using single array. Condition on n,d given is 100. So array size goes the same right? #include #include int f(int n,int d); int dp[100]; int main() { int n,d,k,t; while(1) { for(t=0;t<100;t++) dp[t]=0; scanf("%d %d",&n,&d); if(

Re: [algogeeks] Re: Segmentation fault

2011-06-23 Thread kartik sachan
@ anonymous here u see the formula where it is clearly mention for single step the value of k is not changing so we can solve this question by taking single dimensional array instead of two dimensional array and in 1D array we have large size to store value for DP as compare to 2D array -- You

Re: [algogeeks] Re: Segmentation fault

2011-06-23 Thread saurabh singh
Well how about using a circular linked list for this problem?The same kind of problem was asked in INSOMNIA and I solved it using a circular linked list. On Thu, Jun 23, 2011 at 10:09 PM, anonymous procrastination < opamp1...@gmail.com> wrote: > Thanks for the clarification :) > > -- > You receive

[algogeeks] Re: Segmentation fault

2011-06-23 Thread anonymous procrastination
Thanks for the clarification :) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more o

Re: [algogeeks] Re: Segmentation fault

2011-06-23 Thread harshit pahuja
i meant take a 1d array..as k is the constant for a single test case... On Thu, Jun 23, 2011 at 9:46 PM, anonymous procrastination < opamp1...@gmail.com> wrote: > @Harshit > > Please explain what do you mean by single array? > I'm trying to solve the same problem. > > -- > You receive

[algogeeks] Re: Segmentation fault

2011-06-23 Thread anonymous procrastination
@Harshit Please explain what do you mean by single array? I'm trying to solve the same problem. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group,