Re: [algogeeks] Find peak element in log(n)

2012-06-24 Thread Anshul Agarwal
. 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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anshul Agarwal Computer Science and Engineering

[algogeeks] segment tree problem (spoj GSS1)

2012-02-06 Thread Anshul AGARWAL
long int r; while(m--) { scanf(%d%d,i,j); r=query(1,i-1,j-1,0,n-1); printf(%lld\n,r); } return 0; } *Anshul Agarwal * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Spoj_problem:INUMBER

2012-01-30 Thread Anshul AGARWAL
@vaibhav plz explain how to apply bfs.. *Anshul Agarwal Nit Allahabad Computer Science** * On Mon, Jan 30, 2012 at 4:21 AM, vaibhavmitta...@gmail.com wrote: BFS Regards Vaibhav On , Anshul AGARWAL anshul.agarwa...@gmail.com wrote: hi friends,i m not able to find any logic to solve

[algogeeks] Spoj_problem:INUMBER

2012-01-29 Thread Anshul AGARWAL
hi friends, i m not able to find any logic to solve this problem. Can any one suggest me good algorithm of spoj_problem: (INUMBERhttp://www.spoj.pl/problems/INUMBER/ ). thanx in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] spoj problem:Street parade

2011-12-20 Thread Anshul AGARWAL
Thanx Sharad finally got AC *Anshul Agarwal Nit Allahabad Computer Science** * On Tue, Dec 20, 2011 at 3:16 PM, sharad dixit sharad.emine...@gmail.comwrote: @Anshul AGARWAL Input : 4 2 1 3 4 Expected Output : Yes Your's Code Output : No On 12/20/11, sunny agrawal sunny816.i

Re: [algogeeks] Re: spoj problem

2011-11-17 Thread Anshul AGARWAL
finally got AC,(using bfs) thanx DON for provide such nice test case *Anshul Agarwal Nit Allahabad Computer Science** * On Wed, Nov 16, 2011 at 8:14 PM, SAMMM somnath.nit...@gmail.com wrote: U need to check for the case when (s==g) source and destination are same , I got stuck here , after

Re: [algogeeks] Re: spoj problem

2011-11-16 Thread Anshul AGARWAL
thanx Don. i think my logic is not so good . now i try to make it using bfs . *Anshul Agarwal Nit Allahabad Computer Science** * On Tue, Nov 15, 2011 at 5:36 PM, Don dondod...@gmail.com wrote: This input 100 1 5 5 91 Should output 20. Yours says Take the stairs. 100 1 5 5 89 Should

[algogeeks] spoj problem

2011-11-14 Thread Anshul AGARWAL
; printf(use the stairs\n); break; } } } } Anshul Agarwal Nit Allahabad Computer Science** * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] spoj problem

2011-11-14 Thread Anshul AGARWAL
i m try to increase current floor c by push up button until it equal or greater than g and increase co-responding push p.when my current floor is greater than g.i push down button once and increase p by 1. repeat this loop until i get c==g. *Anshul Agarwal Nit Allahabad Computer Science

[algogeeks] Plz explain the output..........

2011-09-16 Thread Anshul AGARWAL
); } --- *Anshul Agarwal Nit Allahabad Computer Science** * -- 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

Re: [algogeeks] Padding....

2011-09-03 Thread Anshul AGARWAL
#include stdio.h // structure C typedef struct structc_tag { charc; double d; int s; } structc_t; // structure D typedef struct structd_tag { double d; int s; charc; } structd_t; int main() { printf(sizeof(structc_t) = %d\n,