Yeah, Dave. It is simple, but small correction, we need 5621 games to
figure out the winner.
In general, if we are having n participants we need n - 1 games to
determine the final winner. We can conclude the fact, by drawing the
tournament tree for small numbers and count for the games to be held
Hey, it can be done in o(n*logn) time by calling maxheapify function on the
two arrays. Then it decreases the size of the array whose last element is
maximum of the two arrays. I hope you are aware of heap data structure and
you have got the idea how to do it. If not let me know, it will explain
dave how is this different from brute force ?
On Thu, Feb 24, 2011 at 8:56 PM, Dave dave_and_da...@juno.com wrote:
@Ashish: The code seems pretty straightforward, but okay. The outer
for-loop runs through the numbers that have 10-digit squares. The
squares are represented as 64 bit integers
CALL FOR PAPERS
and
Call For Workshop/Session Proposals
FECS'11
The 2011 International Conference on Frontiers
in Education: Computer Science and Computer Engineering
Date and
@jalaj guys please understand how the static and extern work first.
static makes the variables or functions defined in an object file to be
local to that object file.
When you declare the variable or function as extern , it means that
definition is present in some other object file and it will
It is obviously a brute force technique...
Is there any other way of doing it
On Feb 25, 4:13 pm, Arpit Sood soodfi...@gmail.com wrote:
dave how is this different from brute force ?
On Thu, Feb 24, 2011 at 8:56 PM, Dave dave_and_da...@juno.com wrote:
@Ashish: The code seems pretty
Find the sum of digits of all the numbers whose digits are all in ascending
order from left to right. All these numbers lie between 500 to 1000 and
satisfy M divides (M-1)* !* + 1 , where M is any natural number.
(* ! * denotes factorial of the number)
--
best wishes!!
Vaibhav Shukla
Is there a maximum time complexity?
2011/2/25 vaibhav shukla vaibhav200...@gmail.com
Find the sum of digits of all the numbers whose digits are all in ascending
order from left to right. All these numbers lie between 500 to 1000 and
satisfy M divides (M-1)* !* + 1 , where M is any natural
nothing to do with complexity...
just the ans
On Fri, Feb 25, 2011 at 10:23 PM, Rel Guzman Apaza rgap...@gmail.comwrote:
Is there a maximum time complexity?
2011/2/25 vaibhav shukla vaibhav200...@gmail.com
Find the sum of digits of all the numbers whose digits are all in
ascending order
@Venki. Hmmm. Let me see. The problem specified that there were 5623
participants. That makes n = 5623. You say that n-1 games are needed,
and compute that as 5621. So you are saying that 5623 - 1 = 5621. Is
that some kind of new math?
Dave
On Feb 25, 4:01 am, Venki venkatcollect...@gmail.com
@Arpit: Is there any requirement to do it other than by brute force?
Besides, I think it is rather clever brute force.
Dave
On Feb 25, 5:13 am, Arpit Sood soodfi...@gmail.com wrote:
dave how is this different from brute force ?
On Thu, Feb 24, 2011 at 8:56 PM, Dave dave_and_da...@juno.com
its just that i wanted to learn some other way too, where we don't go
linearly over all values
On Fri, Feb 25, 2011 at 11:54 PM, Dave dave_and_da...@juno.com wrote:
@Arpit: Is there any requirement to do it other than by brute force?
Besides, I think it is rather clever brute force.
Dave
@Jammy: No u didn't get me. Here is the explanation of what I meant:
Input : two arrays a and b; and their size size_a andsize_b respectively.
1. Maxheapify both arrays
2. compare the last elements of both the arrays. If the last element of a is
greater than b, swap both the elements . Then
can anybody give me code of making a simple c++ graphical program.
please also write statement of compiling and running the program in
linux.
and if you wish please explain the statements of program with
comments...
--
You received this message because you are subscribed to the Google
@Arpit: Actually, we didn't go over all of the values. The question
asks about 10-digit perfect squares that have non-repeating digits. So
n = 10^10-10^9. The brute force algorithm really would take a look at
all n of those numbers and pick out the ones that both were perfect
squares and had
Hi Dave,
I don't think ur logic will cover all cases like (1,1)(-3,-3), (1,1)
(2,2) a line connecting these points passes through origin,
i think the solution is, we need to compute the slope of the point at index
i with origin and build a binary tree with theses slopes.
but worst cases
Hi Vinay,
Here the condition is Point lies on same circle..
hope you got it.
On Sat, Feb 26, 2011 at 10:58 AM, vinay reddy gvina...@gmail.com wrote:
Hi Dave,
I don't think ur logic will cover all cases like (1,1)(-3,-3), (1,1)
(2,2) a line connecting these points passes through
*Bus Driver Problem Solution*
ok let's say you're driving a bus and it's empty. At the first stop two(2)
people get on. At the second stop five(5) people get on and one(1) person
exits. At the third stop six(6) people get on and four(4) people exit. How
old is the bus driver?
Update Your Answers
I also want to know how to start making graphical program in c++..also
can we integrate database with a c++ application.
actually i want to make a c++ application using both c++ and
databasehow should i start please guide me !!!
On Sat, Feb 26, 2011 at 1:20 AM, UTKARSH SRIVASTAV
19 matches
Mail list logo