An easy programming problem?
-
It was the year 2009 when I went to the regionals of the ACM-IBM programming contest thats when I saw what i thinked the easiest problem. I give you a set of 2D points(1000 max) and the output is how many isoceles triangles can be formed with those points. Later on I realized that problem was trap it has to give the output i less than 2 seconds can you think in a solution? I did later after six hours sitting on my PC That teach me something I will never forget. No matter how great programmer you think you are there is always some problem to solve that is out of your reach
-
It was the year 2009 when I went to the regionals of the ACM-IBM programming contest thats when I saw what i thinked the easiest problem. I give you a set of 2D points(1000 max) and the output is how many isoceles triangles can be formed with those points. Later on I realized that problem was trap it has to give the output i less than 2 seconds can you think in a solution? I did later after six hours sitting on my PC That teach me something I will never forget. No matter how great programmer you think you are there is always some problem to solve that is out of your reach
Vasily Tserekh wrote:
there is always some problem to solve that is out of your reach
I think this is what keeps us moving in a forward direction.
"the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) "It is the celestial scrotum of good luck!" - Nagy Vilmos (2011) "But you probably have the smoothest scrotum of any grown man" - Pete O'Hanlon (2012) -
It was the year 2009 when I went to the regionals of the ACM-IBM programming contest thats when I saw what i thinked the easiest problem. I give you a set of 2D points(1000 max) and the output is how many isoceles triangles can be formed with those points. Later on I realized that problem was trap it has to give the output i less than 2 seconds can you think in a solution? I did later after six hours sitting on my PC That teach me something I will never forget. No matter how great programmer you think you are there is always some problem to solve that is out of your reach
-
It was the year 2009 when I went to the regionals of the ACM-IBM programming contest thats when I saw what i thinked the easiest problem. I give you a set of 2D points(1000 max) and the output is how many isoceles triangles can be formed with those points. Later on I realized that problem was trap it has to give the output i less than 2 seconds can you think in a solution? I did later after six hours sitting on my PC That teach me something I will never forget. No matter how great programmer you think you are there is always some problem to solve that is out of your reach
Vasily Tserekh wrote:
No matter how great programmer you think you are there is always some problem to solve that is out of your reach
Yes, my moments usually starts with 'Hello World' and VB... :-) My boss asked me yesterday if I'd ever used VB.Net. I said no, quite emphatically. That was the end of that conversation.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
-
It was the year 2009 when I went to the regionals of the ACM-IBM programming contest thats when I saw what i thinked the easiest problem. I give you a set of 2D points(1000 max) and the output is how many isoceles triangles can be formed with those points. Later on I realized that problem was trap it has to give the output i less than 2 seconds can you think in a solution? I did later after six hours sitting on my PC That teach me something I will never forget. No matter how great programmer you think you are there is always some problem to solve that is out of your reach
Vasily Tserekh wrote:
can you think in a solution?
I'm not sure how fast it will run (and it depends on the computer), but... Pick a point. Sort the remaining points into a binary tree based on distance from the first point. If any are equal distance, that's an isosceles triangle (so, increment). Repeat, picking each of the rest of the points as the center.
-
It was the year 2009 when I went to the regionals of the ACM-IBM programming contest thats when I saw what i thinked the easiest problem. I give you a set of 2D points(1000 max) and the output is how many isoceles triangles can be formed with those points. Later on I realized that problem was trap it has to give the output i less than 2 seconds can you think in a solution? I did later after six hours sitting on my PC That teach me something I will never forget. No matter how great programmer you think you are there is always some problem to solve that is out of your reach
-
Vasily Tserekh wrote:
there is always some problem to solve that is out of your reach
I think this is what keeps us moving in a forward direction.
"the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
"No, that is just the earthly manifestation of the Great God Retardon." - Nagy Vilmos (2011) "It is the celestial scrotum of good luck!" - Nagy Vilmos (2011) "But you probably have the smoothest scrotum of any grown man" - Pete O'Hanlon (2012)The old carrot on a stick paradigm?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
Vasily Tserekh wrote:
can you think in a solution?
I'm not sure how fast it will run (and it depends on the computer), but... Pick a point. Sort the remaining points into a binary tree based on distance from the first point. If any are equal distance, that's an isosceles triangle (so, increment). Repeat, picking each of the rest of the points as the center.
This would run in O(N2log(N)). For 1,000 points, that is about 32,000,000 operations. I suspect that would run in under 2 seconds on a 2009 desktop computer.
-
It was the year 2009 when I went to the regionals of the ACM-IBM programming contest thats when I saw what i thinked the easiest problem. I give you a set of 2D points(1000 max) and the output is how many isoceles triangles can be formed with those points. Later on I realized that problem was trap it has to give the output i less than 2 seconds can you think in a solution? I did later after six hours sitting on my PC That teach me something I will never forget. No matter how great programmer you think you are there is always some problem to solve that is out of your reach
Gotta love problems like that! I used to work for a company that provides custom mainframe solutions in ADABAS / Natural. One day the company president posed a simple challenge to all of the programmers: Written entirely in Natural, divide a 100 digit number by a 50 digit number. Sounded easy enough, took a little longer than I anticipated (by a couple of hours), but I and one other programmer were able to submit working solutions. Challenges like that definately keep us on our toes!
-
It was the year 2009 when I went to the regionals of the ACM-IBM programming contest thats when I saw what i thinked the easiest problem. I give you a set of 2D points(1000 max) and the output is how many isoceles triangles can be formed with those points. Later on I realized that problem was trap it has to give the output i less than 2 seconds can you think in a solution? I did later after six hours sitting on my PC That teach me something I will never forget. No matter how great programmer you think you are there is always some problem to solve that is out of your reach
Quote:
No matter how great programmer you think you are there is always some problem to solve that is out of your reach
I agree with some previous replies; that one should move forward. But to encourage you even more :D I will tell you that there are problems which probably you won't even solve :) http://en.wikipedia.org/wiki/List_of_unsolved_problems_in_computer_science[^]
best regards.
-
That's why managers pad inexperienced programmers' time estimates. Realizing the complexity of a problem from the beginning is another skill to develop, as important as constructing algorithms. I am in no way implying you are inexperienced.
I think you "speak truth to power" here brother WizardZZ, but, I also think there are often other motivations, of a darker flavor, at work in the padding of time estimates by managers. best, Bill
"The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux
-
Quote:
No matter how great programmer you think you are there is always some problem to solve that is out of your reach
I agree with some previous replies; that one should move forward. But to encourage you even more :D I will tell you that there are problems which probably you won't even solve :) http://en.wikipedia.org/wiki/List_of_unsolved_problems_in_computer_science[^]
best regards.
Oh boy, there are so many problems that are "out of my reach" that I have to survive eating the rotten problems that fall out of the tree by accident, including the worms in them :) The theory of NP-Hard problems is an interesting area to examine in the context of your remarks:[^]. And, then I suppose there are problems that are insoluble: like, perhaps: prove that Godel's theorem that there is no system of logic which cannot be used to construct a self-contradictory statement ... is incorrect ? Or, a little more "mundanely:" prove you can understand what someone you are "in love with" really feels. best, Bill
"The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux
-
Oh boy, there are so many problems that are "out of my reach" that I have to survive eating the rotten problems that fall out of the tree by accident, including the worms in them :) The theory of NP-Hard problems is an interesting area to examine in the context of your remarks:[^]. And, then I suppose there are problems that are insoluble: like, perhaps: prove that Godel's theorem that there is no system of logic which cannot be used to construct a self-contradictory statement ... is incorrect ? Or, a little more "mundanely:" prove you can understand what someone you are "in love with" really feels. best, Bill
"The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux
-
I think you "speak truth to power" here brother WizardZZ, but, I also think there are often other motivations, of a darker flavor, at work in the padding of time estimates by managers. best, Bill
"The greatest mystery is not that we have been flung at random between the profusion of matter and of the stars, but that within this prison we can draw from ourselves images powerful enough to deny our nothingness." Andre Malraux
True, I agree. I was speaking from experience. 2 jobs ago, I was in charge of a junior developer and she would give really short time estimates to everything, but there were times I realized the complexity of what I was assigning her, so I would pad her estimates for her short-sided-ness.