Re: [algogeeks] How to print numbers from 1 to 100 without loop , without recursion , without #define statements , without goto statement

2011-03-17 Thread D.N.Vishwakarma@IITR
*this is a dump solution * On Thu, Mar 17, 2011 at 12:05 AM, gmagog...@gmail.com gmagog...@gmail.comwrote: printf(1 2 3 4 5 6 7 8 9 10 11 12 13...); no loop, no recursion, no define, no goto. HAHA : ) On Wed, Mar 16, 2011 at 12:30 PM, Carl Barton

[algogeeks] [brain teaser ] 17march

2011-03-17 Thread Lavesh Rawat
*Problem Solution* * *Lee's parents have five children, the names of the first four are La, Le, Li, and Lo. What's the name of the fifth child? Update Your Answers at : Click Herehttp://dailybrainteaser.blogspot.com/2011/03/17march.html Solution: Will be updated after 1 day --

Re: [algogeeks] [brain teaser ] 17march

2011-03-17 Thread amit singh
Lu (hint a,e,i ,o,u) On Thu, Mar 17, 2011 at 1:58 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *Problem Solution* * *Lee's parents have five children, the names of the first four are La, Le, Li, and Lo. What's the name of the fifth child? Update Your Answers at : Click

Re: [algogeeks] [brain teaser ] 17march

2011-03-17 Thread Srirang Ranjalkar
@amit have you considered Lee as an answer for that question? :P Thank you, Srirang Ranjalkar -- Luck is when hard work meets opportunity On Thu, Mar 17, 2011 at 2:19 PM, amit singh amit.lu...@gmail.com wrote: Lu (hint a,e,i ,o,u) On Thu, Mar 17, 2011 at 1:58 PM, Lavesh Rawat

Re: [algogeeks] [brain teaser ] 17march

2011-03-17 Thread amit singh
:D trapped On Thu, Mar 17, 2011 at 2:22 PM, kunal srivastav kunal.shrivas...@gmail.com wrote: lol On Thu, Mar 17, 2011 at 2:20 PM, Srirang Ranjalkar srira...@gmail.comwrote: @amit have you considered Lee as an answer for that question? :P Thank you, Srirang Ranjalkar -- Luck is

Re: [algogeeks] [brain teaser ] 17march

2011-03-17 Thread sitaram jaiswal
lee -- 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. For more options, visit this group at

Re: [algogeeks] [brain teaser ] 17march

2011-03-17 Thread nishaanth
:P On Thu, Mar 17, 2011 at 10:52 AM, kunal srivastav kunal.shrivas...@gmail.com wrote: lol On Thu, Mar 17, 2011 at 2:20 PM, Srirang Ranjalkar srira...@gmail.comwrote: @amit have you considered Lee as an answer for that question? :P Thank you, Srirang Ranjalkar -- Luck is when hard

Re: [algogeeks] [brain teaser ] 17march

2011-03-17 Thread Anurag atri
lee ( hint : use those two things that you call eyes :P ) On Thu, Mar 17, 2011 at 2:43 PM, nishaanth nishaant...@gmail.com wrote: :P On Thu, Mar 17, 2011 at 10:52 AM, kunal srivastav kunal.shrivas...@gmail.com wrote: lol On Thu, Mar 17, 2011 at 2:20 PM, Srirang Ranjalkar

Re: [algogeeks] Re: Print Hello

2011-03-17 Thread himanshu kansal
is this possible in c also On Wed, Mar 16, 2011 at 11:57 PM, Manikanta manikantabab...@gmail.comwrote: Thats right in C++. How about in C. On Mar 16, 9:44 pm, kumar anurag anurag.it.jo...@gmail.com wrote: @anurag good. On Wed, Mar 16, 2011 at 9:28 PM, Anurag atri

Re: [algogeeks] Re: Print Hello

2011-03-17 Thread kunal srivastav
n...c does not support classes On Thu, Mar 17, 2011 at 6:10 PM, himanshu kansal himanshukansal...@gmail.com wrote: is this possible in c also On Wed, Mar 16, 2011 at 11:57 PM, Manikanta manikantabab...@gmail.comwrote: Thats right in C++. How about in C. On Mar 16, 9:44 pm, kumar

Re: [algogeeks] Re: Print Hello

2011-03-17 Thread himanshu kansal
is there any way to print hello in c also wdout writing anythng in main() On Thu, Mar 17, 2011 at 6:34 PM, kunal srivastav kunal.shrivas...@gmail.com wrote: n...c does not support classes On Thu, Mar 17, 2011 at 6:10 PM, himanshu kansal himanshukansal...@gmail.com wrote: is this

[algogeeks] Look and say sequence

2011-03-17 Thread rohit
'look and say ' (http://oeis.org/A005150) , begins 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211 , our task is to print this sequence. example: the sequence is: 1, 11 (or one 1), 21 (two 1's), 1211 (one 2, one 1), etc. For the record, each number describes the previous one, using numbers

Re: [algogeeks] [brain teaser ] 17march

2011-03-17 Thread kavitha nk
lee -- //BE COOL// kavi -- 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. For more

Re: [algogeeks] nzec

2011-03-17 Thread kavitha nk
oh 5n.. -- //BE COOL// kavi -- 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. For

Re: [algogeeks] A Puzzling Puzzle

2011-03-17 Thread kavitha nk
i cant get..help me out... -- //BE COOL// kavi -- 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] Re: 10 digit problem

2011-03-17 Thread kavitha nk
50 is the answer.. -- //BE COOL// kavi -- 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] Re: 16march

2011-03-17 Thread kavitha nk
gr8.. -- //BE COOL// kavi -- 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. For more

[algogeeks] random number generator

2011-03-17 Thread saurabh agrawal
Given a function which returns true 60% time and false 40% time. Using this function you have to write a function which returns true 50% of the time. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Another maths problem

2011-03-17 Thread saurabh singh
Find the smallest divisor of 17^13+13*17... PS:please dont say 1 -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] random number generator

2011-03-17 Thread Rahul Singal
use the function which generate true 60% twice . if first time its true and second time false then its true .(probability .6 x .4 =.24 ) if first time its false and second time true then its false .(probability .4 x .6 =.24 ) rest if it is both true or both false then call the procedure again

Re: [algogeeks] Another maths problem

2011-03-17 Thread abhijith reddy
17^13 is odd 13*17 is odd so isn't the answer simply 2 ? On Thu, Mar 17, 2011 at 8:25 PM, saurabh singh saurab...@gmail.com wrote: Find the smallest divisor of 17^13+13*17... PS:please dont say 1 -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- Saurabh Singh

Re: [algogeeks] Another maths problem

2011-03-17 Thread Anurag atri
2 On Thu, Mar 17, 2011 at 8:25 PM, saurabh singh saurab...@gmail.com wrote: Find the smallest divisor of 17^13+13*17... PS:please dont say 1 -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- You

Re: [algogeeks] SPOJ problem-BRCKTS

2011-03-17 Thread bharath kannan
sorry guyz... Had to print YES n NO.. i printed as Yes n No... Got ac.. Sorry for the trouble.. On Wed, Mar 16, 2011 at 10:24 PM, Bharath 2009503507 CSE bharathgo...@gmail.com wrote: i am new to segment trees..i tried this problem in spoj.. http://www.spoj.pl/problems/BRCKTS am getting WA..

[algogeeks] Re: A Billion Number Question

2011-03-17 Thread arpit.gupta
read the first no. . now ans= first no +1; if now ans is encountered while reading the next nos. add 1 to ans. i.e. ans++; On Mar 17, 2:18 am, bittu shashank7andr...@gmail.com wrote: Given an input file with four billion integers, provide an algorithm to generate an integer which is not

[algogeeks] Re: A Billion Number Question

2011-03-17 Thread Don
This only works if the file is sorted. If the file starts out with values 5,7,6,... and never contains another 7, the result will be 7, which is in the file. On Mar 17, 12:19 pm, arpit.gupta arpitg1...@gmail.com wrote: read the first no. . now ans= first no +1; if now ans is encountered while

[algogeeks] Re: random number generator

2011-03-17 Thread Don
bool uniform() { static bool state = true; state = !state; return state ^ nonuniform(); } On Mar 17, 9:24 am, saurabh agrawal saurabh...@gmail.com wrote: Given a  function which returns true 60% time and false 40% time. Using this function you have to write a function which returns true

[algogeeks] Re: Spoj Problem

2011-03-17 Thread KK
i m getting TLE for this soln and m not getting the concept used in the above soln can anyone help?? #includeiostream using namespace std; int main() { int t,n,k,no,flag; scanf(%d,t); while(t--) { scanf(%d,n); k = n; int a[100] = {0};

[algogeeks] Re: random number generator

2011-03-17 Thread Dave
@Don: Clever and efficient code to meet the problem statement precisely. It does give true on half of the calls, but it doesn't give true with probability 50% on any given call, so we wouldn't want to use it to model a fair coin. Dave On Mar 17, 1:03 pm, Don dondod...@gmail.com wrote: bool

Re: [algogeeks] Another maths problem

2011-03-17 Thread saurabh singh
Gud observation.Acknowledge it was too easy but i have seen people using binomial expansion to get the answer..lol -- 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

Re: [algogeeks] Re: Print Hello

2011-03-17 Thread pacific pacific
Does C struct have constructor ? On Fri, Mar 18, 2011 at 12:55 AM, Don dondod...@gmail.com wrote: int n = printf(Hello\n); int main() { } On Mar 17, 8:08 am, himanshu kansal himanshukansal...@gmail.com wrote: is there any way to print hello in c also wdout writing anythng in

[algogeeks] Re: Print Hello

2011-03-17 Thread .bashrc
@Don.Its illegal in c(Or in c99) to initialize a variable with anything other than a constant. @pacific No c structures do not support constructor(Or destructor) On Mar 18, 9:08 am, pacific pacific pacific4...@gmail.com wrote: Does  C struct have constructor ? On Fri, Mar 18, 2011 at 12:55

Re: [algogeeks] Re: Print Hello

2011-03-17 Thread Manikanta Babu
@Dondod is right. It works perfectly. Because printf returns the number of characters printed so n will be initialized with the number of characters. You can try out this simple program. I checked its working perfectly. Thanks, Mani On Fri, Mar 18, 2011 at 9:59 AM, .bashrc saurab...@gmail.com