Re: [algogeeks] amazon

2011-02-09 Thread jalaj jaiswal
yeah .. the input will bw given that only for which solution is possible On Wed, Feb 9, 2011 at 1:18 PM, Jitesh Kumar jitesh2...@gmail.com wrote: Can you give me solution for N=1 and N=2? I don't think that it is possible for every N. -- You received this message because you are subscribed

Re: [algogeeks] amazon

2011-02-09 Thread Jitesh Kumar
For N=3, multiple solutions exists 3 1 2 1 3 2 2 3 1 2 1 3 what about this?? On Wed, Feb 9, 2011 at 1:35 PM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote: yeah .. the input will bw given that only for which solution is possible On Wed, Feb 9, 2011 at 1:18 PM, Jitesh Kumar

Re: [algogeeks] amazon

2011-02-09 Thread jalaj jaiswal
This is not a solution dude in the solution the sum of any 2 consecutive nos shld be a perfect square :) On Wed, Feb 9, 2011 at 2:19 PM, Jitesh Kumar jitesh2...@gmail.com wrote: For N=3, multiple solutions exists 3 1 2 1 3 2 2 3 1 2 1 3 what about this?? On Wed, Feb 9, 2011 at 1:35 PM,

Re: [algogeeks] amazon

2011-02-09 Thread Jitesh Kumar
I didn't get you.. In your example One of the possible placement for 7 numbers in 14 positions is : 5 7 2 3 6 2 5 3 4 7 1 6 1 4 there is no perfect square... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] c++ program

2011-02-09 Thread Anil Kumar aRY@
Write a program that reads a contents of webpages? -- *Anil Kumar Arya* *B.Tech 2nd Year* *Motilal Nehru National Institute of Technology,* *Allahabad* *211004* *Email id:-**aryaanil...@gmail.com * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] amazon

2011-02-09 Thread jalaj jaiswal
@ jitesh i am sorry that was for a different question yeah your interpretation is right On Wed, Feb 9, 2011 at 3:02 PM, Jitesh Kumar jitesh2...@gmail.com wrote: I didn't get you.. In your example One of the possible placement for 7 numbers in 14 positions is : 5 7 2 3 6 2 5 3 4 7 1 6 1 4

Re: [algogeeks] CODECHEF FLIP COIN problem

2011-02-09 Thread Arpit Sood
there is problem with the update function... On Tue, Feb 8, 2011 at 8:14 PM, Gaurav Saxena grvsaxena...@gmail.comwrote: Hey thanks for your help I have written a code using range trees but I am still getting TLE [?][?][?] Please suggest me something Here is my code /* * File: main1.c

[algogeeks] m-permutation

2011-02-09 Thread punnu
Suppose n people are arranged in a circle. Number the people from 1 to n. in the clockwise order. We are given an integer ,m = n. Beginning with the person with designated number 1, we proceed around the circle (in clockwise order) removing every mth person. After each person is removed, counting

Re: [algogeeks] Re: Meetings puzzle

2011-02-09 Thread Ujjwal Raj
Input: n meetings A meeting e(i) has start time s(i) and finish time f(i). Sort n events based on there finish time f(i) Say sorted meeting(based on finishing time) are: e1,e2,e3,e4,...en E(t): denotes the maximum no of meetings conducted where 0 = time = t. E(f1) = e1 E(f2) = max(E(s2) + 1),

Re: [algogeeks] c++ program

2011-02-09 Thread Anil Kumar aRY@
thanx On Wed, Feb 9, 2011 at 3:47 PM, Rajeev Kumar rajeevprasa...@gmail.comwrote: I don't know about cpp.But you can do it using selenium framework... On Wed, Feb 9, 2011 at 3:04 PM, Anil Kumar aRY@ aryaanil...@gmail.comwrote: Write a program that reads a contents of webpages? -- *Anil

[algogeeks] no. of passwords

2011-02-09 Thread snehal jain
how many passwords can be made if 1. there should be atleast 3 capital letters 2. atleast 3 small letters 3. atleast 2 numbers 0-9 4 the password should has length=10 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] no. of passwords

2011-02-09 Thread sunny agrawal
is it 26C3 * 26C3 * 10C2 * 62C2 * 10! On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.com wrote: how many passwords can be made if 1. there should be atleast 3 capital letters 2. atleast 3 small letters 3. atleast 2 numbers 0-9 4 the password should has length=10 -- You

Re: [algogeeks] Re: Meetings puzzle

2011-02-09 Thread Tushar Bindal
what are f1, f2, f3,...? On Wed, Feb 9, 2011 at 5:05 PM, Ujjwal Raj ujjwal@gmail.com wrote: Input: n meetings A meeting e(i) has start time s(i) and finish time f(i). Sort n events based on there finish time f(i) Say sorted meeting(based on finishing time) are: e1,e2,e3,e4,...en

Re: [algogeeks] no. of passwords

2011-02-09 Thread Tushar Bindal
Are all the selected letters or numbers always different? If they can also be same then answer would be different. On Wed, Feb 9, 2011 at 7:20 PM, sunny agrawal sunny816.i...@gmail.comwrote: is it 26C3 * 26C3 * 10C2 * 62C2 * 10! On Wed, Feb 9, 2011 at 7:16 PM, snehal jain

[algogeeks] Re: Meetings puzzle

2011-02-09 Thread Tushar
sorry. did not go thru it thoroughly earlier. got it now. On Feb 9, 7:35 pm, Tushar Bindal tushicom...@gmail.com wrote: what are f1, f2, f3,...? On Wed, Feb 9, 2011 at 5:05 PM, Ujjwal Raj ujjwal@gmail.com wrote: Input: n meetings A meeting e(i) has start time s(i) and finish time

[algogeeks] MINIMUM POSITIVE SUM

2011-02-09 Thread Manish Verma
Given: An array of integers(may be both positive and negative), we have to find out the minimum positive sum of array(not necessarily continuous). example:- {1,-5,7,10,-14,16,-17,20,21,22} here answer is -5,-17,22 having sum=0; -- You received this message because you are subscribed

[algogeeks] MINIMUM POSITIVE SUM

2011-02-09 Thread MONSIEUR
Given: An array of integers(may be both positive and negative), we have to find out the minimum positive sum of array(not necessarily continuous). example:- {1,-5,7,10,-14,16,-17,20,21,22} here answer is -5,-17,22 having sum=0; -- You received this message because you are subscribed

Re: [algogeeks] no. of passwords

2011-02-09 Thread snehal jain
letters and no. can be same... so the ans shd be different On Wed, Feb 9, 2011 at 8:14 PM, Tushar Bindal tushicom...@gmail.com wrote: Are all the selected letters or numbers always different? If they can also be same then answer would be different. On Wed, Feb 9, 2011 at 7:20 PM, sunny

[algogeeks] Re: MINIMUM POSITIVE SUM

2011-02-09 Thread MONSIEUR
@jalaj: text missing.??? I think i've mentioned question properly.is there any thing more u require? n Feb 9, 9:45 pm, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote: @monsieur ... text missing dude On Wed, Feb 9, 2011 at 10:12 PM, MONSIEUR monsieur@gmail.com wrote: Given: An

Re: [algogeeks] no. of passwords

2011-02-09 Thread sunny agrawal
yes they can be same, forgot to consider that so it should be (26^3)*(26^3)*(10^2)*(62^2)*(10!) ?? On Wed, Feb 9, 2011 at 10:20 PM, snehal jain learner@gmail.com wrote: letters and no. can be same... so the ans shd be different On Wed, Feb 9, 2011 at 8:14 PM, Tushar Bindal

Re: [algogeeks] Re: MINIMUM POSITIVE SUM

2011-02-09 Thread Rel Guzman Apaza
I think the only solution will be finding all subsets. 2011/2/9 MONSIEUR monsieur@gmail.com @jalaj: text missing.??? I think i've mentioned question properly.is there any thing more u require? n Feb 9, 9:45 pm, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote: @monsieur ... text

Re: [algogeeks] m-permutation

2011-02-09 Thread Rel Guzman Apaza
maybe using a circular linked list. 2011/2/9 punnu punnu.gino...@gmail.com Suppose n people are arranged in a circle. Number the people from 1 to n. in the clockwise order. We are given an integer ,m = n. Beginning with the person with designated number 1, we proceed around the circle (in

Re: [algogeeks] no. of passwords

2011-02-09 Thread snehal jain
@sunny i think even this wont work multiplying by 10! is wrong as when we have selecting same letters or numbers then permutions will be fewer than 10!.. correct me if i am wrong.. On Wed, Feb 9, 2011 at 10:33 PM, sunny agrawal sunny816.i...@gmail.comwrote: yes they can be same, forgot to

Re: [algogeeks] no. of passwords

2011-02-09 Thread sunny agrawal
right, it will also not work On Wed, Feb 9, 2011 at 10:42 PM, snehal jain learner@gmail.com wrote: @sunny i think even this wont work multiplying by 10! is wrong as when we have selecting same letters or numbers then permutions will be fewer than 10!.. correct me if i am wrong.. On

[algogeeks] Re: MINIMUM POSITIVE SUM

2011-02-09 Thread MONSIEUR
@apaza: brute force.checking all combinations(with at least one negative number,if any)..too hard buddy. On Feb 9, 10:07 pm, Rel Guzman Apaza rgap...@gmail.com wrote: I think the only solution will be finding all subsets. 2011/2/9 MONSIEUR monsieur@gmail.com @jalaj: text

Re: [algogeeks] CODECHEF FLIP COIN problem

2011-02-09 Thread Arpit Sood
you are not actually using the concept of lazy propagation in the code, you are doing update in O(n). if you want the solution then reply back. On Wed, Feb 9, 2011 at 6:22 PM, Gaurav Saxena grvsaxena...@gmail.comwrote: @arpit : could you please tell me what is the problem with the update

[algogeeks] Re: MINIMUM POSITIVE SUM

2011-02-09 Thread MONSIEUR
@sunny: actually it is not like maximum positive sum.it is necessary to select at least one number.The only constraint is MINIMUM POSITIVE SUM , If all numbers are negative then print simply no positive sum exist. example: {-300,98,-230} answer: 98 On Feb 9, 10:23 pm, sunny agrawal

Re: [algogeeks] CODECHEF FLIP COIN problem

2011-02-09 Thread Gaurav Saxena
Yes actually I could not figure out how to implement that lazy propagation in the array . Yes please help me in doing that. On Wed, Feb 9, 2011 at 10:56 PM, Arpit Sood soodfi...@gmail.com wrote: you are not actually using the concept of lazy propagation in the code, you are doing update in

[algogeeks] Re: MINIMUM POSITIVE SUM

2011-02-09 Thread Dave
@Monsieur: Note that 0 is not positive so it doesn't match your stated solution requirement. Maybe you meant non-negative instead of positive, or maybe you meant that the answer is 1, having sum=1. Dave On Feb 9, 10:42 am, MONSIEUR monsieur@gmail.com wrote: Given: An array of integers(may

[algogeeks] spoj-RENT problem

2011-02-09 Thread keyankarthi
https://www.spoj.pl/problems/RENT/ tried dp for this problem.. getting tle.. classifier says this is binary search. not able to get how to binary search this problem.. help me out... thanks.. karthikeyan.. -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] m-permutation

2011-02-09 Thread Jhosimar Arias
This is a josephus problem, using a circular linked list takes cuadratic time O( m n ), I think the josephus problem can be solved using rank trees in O(n log n). Construct a rank tree from an array with n elements storing the elements in a binary tree in in-order sequence ( Constructor ). Store

[algogeeks] SUDHIR MISHRA wants to chat

2011-02-09 Thread SUDHIR MISHRA
--- SUDHIR MISHRA wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-62d5befb93-a1202cc5cd-5oEiMcLpaEPVY-UR9eGSSYdrezQ You'll

[algogeeks] Re: no. of passwords

2011-02-09 Thread Dave
The following combinations of capital letters C, lower case letters l, and digits d are possible: C l d Number possible 3 3 4 10C3 * 26^3 * 7C3 * 26^3 * 4C4 * 10^4 3 4 3 10C3 * 26^3 * 7C4 * 26^4 * 3C3 * 10^3 3 5 2 10C3 * 26^3 * 7C5 * 26^5 * 2C2 * 10^2 4 3 3 10C4 * 26^4 * 6C3 * 26^3 * 3C3 *

Re: [algogeeks] no. of passwords

2011-02-09 Thread Manmeet Singh
@ Dave : I think this shud also give the same result C(26, 3) * C(26, 3) * C(10, 2) * C(62, 2) On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.com wrote: how many passwords can be made if 1. there should be atleast 3 capital letters 2. atleast 3 small letters 3. atleast 2

Re: [algogeeks] no. of passwords

2011-02-09 Thread Manmeet Singh
Also it shud now be multiplied with Factorial of 10 On Thu, Feb 10, 2011 at 1:14 AM, Manmeet Singh mans.aus...@gmail.comwrote: @ Dave : I think this shud also give the same result C(26, 3) * C(26, 3) * C(10, 2) * C(62, 2) On Wed, Feb 9, 2011 at 7:16 PM, snehal jain learner@gmail.com

[algogeeks] Re: no. of passwords

2011-02-09 Thread Dave
No. That is too large, at 2,087,438,895,360,000,000. Analyzing your expression, 26C3 is the number of ways to choose 3 different letters, but the letters can be the same. The number of combinations of 3 letters with repetitions is 26^3. So that aspect of your formula is too small. However, you

[algogeeks] MicroSoft Interview Question-9 February 2011

2011-02-09 Thread Divesh Dixit
1. write a function to convert a decimal no. to Roman no. (10 marks) 2. Design a elevators system for 50 storied hotel. condition are... at least one left should be available on ground flore. Min. time is expected ot reach the any floore... (5 marks) 3. Design all the test case for

[algogeeks] Re: no. of passwords

2011-02-09 Thread SVIX
1. there should be atleast 3 capital letters 2. atleast 3 small letters - 6 spaces gone for these, with repetitions allowed. for 3 spaces, we have 26^3 possibilities, and they can be arranged in 10C3 ways... for the next 3, they can be arranged in 7C3 ways 3. atleast 2 numbers 0-9 now, 4

[algogeeks] Re: no. of passwords

2011-02-09 Thread Dave
@SVIX: According to my calculation, this gives 2,992,430,052,218,880,000, almost 12 times the correct answer, 251,471,033,958,144,000, that I gave earlier in posting http://groups.google.com/group/algogeeks/msg/bb2269736a997419. This is because you are counting some passwords multiple times.

[algogeeks] Re: no. of passwords

2011-02-09 Thread SVIX
ah... I see what you're saying... On Feb 9, 8:56 pm, Dave dave_and_da...@juno.com wrote: @SVIX: According to my calculation, this gives 2,992,430,052,218,880,000, almost 12 times the correct answer, 251,471,033,958,144,000, that I gave earlier in

[algogeeks] Call for Papers: The 2011 International Conference on Foundations of Computer Science (FCS'11), USA, July 18-21, 2011

2011-02-09 Thread A. M. G. Solo
   CALL  FOR  PAPERS and   Call For Workshop/Session Proposals       FCS'11    The 2011 International Conference on Foundations of Computer Science      Date and Location: July

[algogeeks] array problem

2011-02-09 Thread jalaj jaiswal
sort the input array. only following operations on array is allowed: 1)get(index) -gets the element at that index 2)reverse(int start,int end) - example reverse(1,3) for the array [1,2,3,4,5] will return [1,4,3,2,5] better then nlogn -- With Regards, *Jalaj Jaiswal* (+919019947895) Software

[algogeeks] Call for Papers - Technospeak (Part of Sankalan 2011): Department of Computer Science, University of Delhi

2011-02-09 Thread Sankalan DUCSS
Hi! The Department of Computer Science, University of Delhi is organising its annual technical fest - Sankalan 2011 on 5th and 6th of March, 2011. The fest consists of technical as well as non technical events. Kindly refer to http://cs.du.ac.in/sankalan2011 A technical paper presentation event