Re: [algogeeks] Re: SPOJ PROBLEM

2011-02-04 Thread Logic King
@juver++ thanks, learned about Unicode today !! On Fri, Feb 4, 2011 at 12:48 PM, juver++ avpostni...@gmail.com wrote: It is unicode I think. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Delightfully Puzzle

2011-02-04 Thread bittu
A blind man is handed a deck of 52 cards and told that exactly 10 of these cards are facing up. How can he divide the cards into two piles, not necessarily of equal size, with each pile having the same number of cards facing up? Solution Thanks Shashank -- You received this message because you

[algogeeks] Delightfully Puzzle

2011-02-04 Thread bittu
A blind man is handed a deck of 52 cards and told that exactly 10 of these cards are facing up. How can he divide the cards into two piles, not necessarily of equal size, with each pile having the same number of cards facing up? Solution I need Some Discussion on this.. Thanks Shashank -- You

[algogeeks] Re: Delightfully Puzzle

2011-02-04 Thread juver++
Make 2 piles of 10 and 42 cards. Suppose in the first pile there are A facing up cards, in the second one B = 10 - A. Then flip all cards in the first pile. So it will contain 10-A facing up cards, the same number as in the second pile. Problem solved :) -- You received this message because

Re: [algogeeks] dp

2011-02-04 Thread shubham singh
if (u r calling dp of spoj as basic) { i would say u are a champ already ; } else { do practise more on spoj } -- 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

[algogeeks] BISHOPS

2011-02-04 Thread Logic King
please help me solve the problem on SPOJ https://www.spoj.pl/problems/BISHOPS/ The logic of the problem is very easy i.e. 2*n-2 but i am getting WA bcoz i am not able to deal with the large inputs.[?] plz help me how to get this AC. #includestdio.h int main() { long long int

[algogeeks] Easy problem but unable to handle large input

2011-02-04 Thread Logic King
Now,this is a very basic and very easy problem on SPOJ but again i failed to handle large inputs..someone please help me to get this AC https://www.spoj.pl/problems/JULKA/ My code which gave wrong answer is--- #includestdio.h int main() { long long int k,n,i,x1,x2;

Re: [algogeeks] dp

2011-02-04 Thread Manmeet Singh
@ Shubham : Well Said :) :) On Fri, Feb 4, 2011 at 8:01 PM, shubham singh shubhamsisodia0...@gmail.comwrote: if (u r calling dp of spoj as basic) { i would say u are a champ already ; } else { do practise more on spoj } -- You received this message because you are subscribed to the

Re: [algogeeks] BISHOPS

2011-02-04 Thread Manmeet Singh
C/C++ user : Take input in a char array or string(if using C++) : a now do string addition. : a = a + a; now do string substraction. : a = a - 2. Java user : Use BigInt class On Fri, Feb 4, 2011 at 8:12 PM, Logic King crazy.logic.k...@gmail.comwrote: please help me solve the problem on SPOJ

Re: [algogeeks] Delightfully Puzzle

2011-02-04 Thread Nikhil Jindal
The puzzle has recently been discussed in another thread. On Fri, Feb 4, 2011 at 2:20 PM, bittu shashank7andr...@gmail.com wrote: A blind man is handed a deck of 52 cards and told that exactly 10 of these cards are facing up. How can he divide the cards into two piles, not necessarily of

Re: [algogeeks] Re: top search queries

2011-02-04 Thread Algoose chase
Going by the hint given in the problem Divide the stream into windows and assume that we have enough space to store all the queries from the stream window in a hash table along frequency count. Also maintain a global Hash table that will contain the frequency counts of top n queries seen so far.

[algogeeks] Re: Easy problem but unable to handle large input

2011-02-04 Thread juver++
Java, python or written big integer class. -- 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.

Re: [algogeeks] BISHOPS

2011-02-04 Thread subramania jeeva
Use python for arithmetic operation of large numbers.. :) Cheers ~ Jeeva ~ On Fri, Feb 4, 2011 at 8:32 PM, Manmeet Singh mans.aus...@gmail.com wrote: C/C++ user : Take input in a char array or string(if using C++) : a now do string addition. : a = a + a; now do string

Re: [algogeeks] Re: Easy problem but unable to handle large input

2011-02-04 Thread subramania jeeva
Else you are not familiar with above means, use string multiplication,addition subtraction... :) Cheers ~ Jeeva ~ On Fri, Feb 4, 2011 at 9:02 PM, juver++ avpostni...@gmail.com wrote: Java, python or written big integer class. -- You received this message because you are

Re: [algogeeks] dp

2011-02-04 Thread Balaji S
@Shubam: i ll do the else part rather.. :) and nice reply..;-);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] Spoj Problem : Small Factorials

2011-02-04 Thread Rahul Verma
Hi Group, Let me help to solve this problem of SPOJ https://www.spoj.pl/problems/FCTRL2/ The approach to solve the problem is very easy and I'm confused that how to store such a large no. like 100! in a variable using C++ Language. Thanx Regards, Rahul Verma -- You received this message

Re: [algogeeks] Spoj Problem : Small Factorials

2011-02-04 Thread subramania jeeva
Use string multiplication. :) Cheers ~ Jeeva ~ On Fri, Feb 4, 2011 at 9:49 PM, Rahul Verma rahulverma@gmail.comwrote: Hi Group, Let me help to solve this problem of SPOJ https://www.spoj.pl/problems/FCTRL2/ The approach to solve the problem is very easy and I'm

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Rahul Verma
@jeeva Can you pls explain me in detail or some link to the tutorial of string manipulation in C++. I googled about it but most of the links are in Python Javascript. On Feb 4, 9:29 pm, subramania jeeva subramaniaje...@gmail.com wrote: Use string multiplication. :) Cheers           ~ Jeeva ~

Re: [algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread abhijith reddy
http://zobayer.blogspot.com/2010/03/small-bigint-library.html On Fri, Feb 4, 2011 at 10:24 PM, Rahul Verma rahulverma@gmail.comwrote: @jeeva Can you pls explain me in detail or some link to the tutorial of string manipulation in C++. I googled about it but most of the links are in Python

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Dave
@Rahul: Given that 100! 100^100 = 10^200, we know that 100! has less than 200 digits. Assuming 32-bit integers, we might choose to store anywhere from 1 to 7 digits in an integer, realizing that we have to multiply the integer by a number up to 100 and still want the result to be less than 2^31.

[algogeeks] Earn a ipod with just a facebook like

2011-02-04 Thread Aman Goyal
http://www.studyshare.in/share/content.php?195 I have received a apple shuffle few days back with just liking a facebook video. I am still boggled, but I want all of you earn it. Yes, this may sound spam, but it is a real story. pre Congrats for an ipod/tshirt/mug who are going to 'like' this

[algogeeks] NEED JSP EBOOK....

2011-02-04 Thread UMESH KUMAR
Hello Everybody I need right now JSP E-book . So, Everybody do u have good JSP please send on Group . Thanks and Regards Umesh Kumar D.U. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Rahul Verma
@Dave In the line t=p/100; what is the value of p here or what it means? On Feb 4, 9:57 pm, Dave dave_and_da...@juno.com wrote: @Rahul: Given that 100! 100^100 = 10^200, we know that 100! has less than 200 digits. Assuming 32-bit integers, we might choose to store anywhere from 1 to 7

[algogeeks] Re: BISHOPS

2011-02-04 Thread Rahul Verma
@king Can you pls told me that wat would be the position at where bishops might place in the 2X2, 3X3, 4X4 chessboard. On Feb 4, 8:39 pm, subramania jeeva subramaniaje...@gmail.com wrote: Use python for arithmetic operation of large numbers.. :) Cheers           ~ Jeeva ~ On Fri,

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Dave
Oh. That is supposed to be t. So the line actually could read t /= 1; Sorry for the typo. Dave On Feb 4, 11:58 am, Rahul Verma rahulverma@gmail.com wrote: @Dave In the line t=p/100; what is the value of p here or what it means? On Feb 4, 9:57 pm, Dave

[algogeeks] what will be the output

2011-02-04 Thread priya mehta
#include stdio.h #define f(a,b) a*##*b #define g(a) *#*a #define h(a) g(a) *int* main() { printf(%s\n,h(f(1,2))); printf(%s\n,g(f(1,2))); *return* 0; } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] what will be the output

2011-02-04 Thread rajat ahuja
12 and f(1,2) On Sat, Feb 5, 2011 at 12:46 AM, priya mehta priya.mehta...@gmail.comwrote: #include stdio.h #define f(a,b) a*##*b #define g(a) *#*a #define h(a) g(a) *int* main() { printf(%s\n,h(f(1,2))); printf(%s\n,g(f(1,2))); *return* 0;

Re: [algogeeks] what will be the output

2011-02-04 Thread priya mehta
thats amazing :) :) but i wanted to know the explanation dear. On Sat, Feb 5, 2011 at 12:49 AM, rajat ahuja catch.rajatah...@gmail.comwrote: 12 and f(1,2) On Sat, Feb 5, 2011 at 12:46 AM, priya mehta priya.mehta...@gmail.comwrote: #include stdio.h #define f(a,b) a*##*b #define

Re: [algogeeks] what will be the output

2011-02-04 Thread rajat ahuja
ohk i try to xplain , first u understand abt two macros operator # operator makes string like #define g(a) *#*a WTEVER value of a will come ,this operator wil convert that into string noe 2nd operator is concatenation one like #define f(a,b) a*##*b here a and b wil get concatenated to form

[algogeeks] Re: Spoj Problem : Small Factorials

2011-02-04 Thread Rahul Verma
Thanx to all @above. I got the result ACC. On Feb 5, 12:45 am, sunny agrawal sunny816.i...@gmail.com wrote: http://www.codechef.com/wiki/tutorial-small-factorials On Fri, Feb 4, 2011 at 11:52 PM, Dave dave_and_da...@juno.com wrote: Oh. That is supposed to be t. So the line actually

[algogeeks] c programming question

2011-02-04 Thread jagannath prasad das
*#includestdio.h void main(void) { int a=10,b; b=a++ + ++a; printf(%d,%d,%d,%d,b,a++,a,++a); } *what is the answer?how are the function parameters passed on the stack? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

[algogeeks] Single Server Queue Simulation Program

2011-02-04 Thread Glauben
Hello , who have single server queue simulation program c or c++ ? Please All the best . -- 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

Re: [algogeeks] c programming question

2011-02-04 Thread aniket chatterjee
The answer will be compiler dependent.Google Sequence Point in C. -- 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

Re: [algogeeks] c programming question

2011-02-04 Thread ankit sablok
the output is 22 13 13 as increment and decrement operators associate from right to left hence first ++a will be evluated which makes a=11 then a++ is evaluated as its a postfix operation hence b=a+a=11+11=22 and after this a =12 then in printf statement again right associativity follows hence ++a

Re: [algogeeks] BISHOPS

2011-02-04 Thread Arvinth Deenadayalan
Hi all, I guess the bishops problem has a generic solution. The formula is 2n-2. Where n is the chess board size n * n . Regarding the arrangement one can place n bishops in one side of the board and on the opposite side you can place n-2 bishops starting from the position n/2 to n-2 position, and