yup it can be further reduced but i think u need a new approach. (m,m) is a
big hint . try some nCp type of solution.

#define s(n) scanf("%d",&n)
#define I int
I a[14][14],t,n;
I d(I m,I n)
{ I s=a[m][n],
  k=(!m||!n)?1:(s?s:d(m-1,n)+d(m,n-1));
  s=k;return k;
}
main()
{
      s(t);
      while(t--)
      {
                s(n);
                printf("%d\n",d(n,n));
                }
      return 0;
}


On Thu, Dec 15, 2011 at 6:10 PM, saurabh singh <[email protected]> wrote:

> Post the formatted code too.(With proper indents)Then it would be easier
> for others to work on it,
>
>
> On Thu, Dec 15, 2011 at 11:47 PM, anubhav raj <[email protected]>wrote:
>
>> we have to submit it in 120 byte cn ne 1 tl me dat whr z the chances of
>> further byte reduction in this code.........
>> #include<stdio.h>
>> #define s(n) scanf("%d",&n)
>> #define I int
>> I a[14][14];I d(I m,I n){I s=a[m][n];I k;if(!m||!n)k=1;else
>> if(s)k=s;else{k=d(m-1,n)+d(m,n-1);s=k;}return k;}main(){I
>> t,n,k;s(t);while(t--){s(n);k=d(n,n);printf("%d\n",k);}}
>>
>> tnx in advnce............
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT ALLAHABAD
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to