Re: [algogeeks] Re: SPOJ problem- TRICOUNT

2011-06-04 Thread Anirudh S
I am still working on arriving at a recursive solution but these links might help. http://mathworld.wolfram.com/TriangleTiling.html http://oeis.org/A002717 http://oeis.org/A002717 On Mon, Mar 21, 2011 at 5:50 PM, cegprakash cegprak...@gmail.com wrote: hello... someone plz tell me how to arrive

[algogeeks] Re: SPOJ problem- TRICOUNT

2011-06-04 Thread Dave
Also http://www.mathematik.uni-bielefeld.de/~sillke/SEQUENCES/grid-triangles. Dave On Jun 4, 8:28 am, Anirudh S anirudh24se...@gmail.com wrote: I am still working on arriving at a recursive solution but these links might help. http://mathworld.wolfram.com/TriangleTiling.html

[algogeeks] Re: SPOJ problem- TRICOUNT

2011-03-21 Thread cegprakash
hello... someone plz tell me how to arrive @ that formula.. -- 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] Re: SPOJ problem- TRICOUNT

2011-03-20 Thread cegprakash
now tell how u arrive at this formula? On Mar 20, 6:25 am, Dave dave_and_da...@juno.com wrote: Oops. Sorry. The correct formula is n*(n+2)*(2*n+1)/8. Dave On Mar 19, 5:26 pm, sunny sunny.verma...@gmail.com wrote: this formula is giving wrong!!!.. :( can u pls tell the approach -- You

[algogeeks] Re: SPOJ problem- TRICOUNT

2011-03-19 Thread cegprakash
i've modified my algorithm but i'm getting wrong answer. someone help.. #includeiostream using namespace std; unsigned long long start,end,arr[101],arr2[101]; int main(){ int j,t,i,n; for(i=0;i100;i++){ arr[i]=i+1+arr[i-1]; } for(i=0;i100;i++) { arr[i]+=arr[i-1]; } arr2[1]=1;

[algogeeks] Re: SPOJ problem- TRICOUNT

2011-03-19 Thread Dave
Isn't the number of triangles in level n just n*(n^2 + 6 n - 1)/6? Dave On Mar 19, 2:47 pm, cegprakash cegprak...@gmail.com wrote: i've modified my algorithm but i'm getting wrong answer. someone help.. #includeiostream using namespace std; unsigned long long

[algogeeks] Re: SPOJ problem- TRICOUNT

2011-03-19 Thread sunny
this formula is giving wrong!!!.. :( can u pls tell the 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, send email to

[algogeeks] Re: SPOJ problem- TRICOUNT

2011-03-19 Thread cegprakash
my algo is working fine.. got acc:) :) small error :P -- 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] Re: SPOJ problem- TRICOUNT

2011-03-19 Thread Dave
Oops. Sorry. The correct formula is n*(n+2)*(2*n+1)/8. Dave On Mar 19, 5:26 pm, sunny sunny.verma...@gmail.com wrote: this formula is giving wrong!!!.. :( can u pls tell the approach -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post