Answer: Both cannonballs will hit the ground at the same time.
Step-by-step explanation:
Suppose that a given object is on the air. The only force acting on the object (if we ignore air friction and such) will be the gravitational force.
then the acceleration equation is only on the vertical axis, and can be written as:
a(t) = -(9.8 m/s^2)
Now, to get the vertical velocity equation, we need to integrate over time.
v(t) = -(9.8 m/s^2)*t + v0
Where v0 is the initial velocity of the object in the vertical axis.
if the object is dropped (or it only has initial velocity on the horizontal axis) then v0 = 0m/s
and:
v(t) = -(9.8 m/s^2)*t
Now, if two objects are initially at the same height (both cannonballs start 1 m above the ground)
And both objects have the same vertical velocity, we can conclude that both objects will hit the ground at the same time.
You can notice that the fact that one ball is fired horizontally and the other is only dropped does not affect this, because we only analyze the vertical problem, not the horizontal one. (This is something useful to remember, we can separate the vertical and horizontal movement in these type of problems)