I am feeling a little difficulty in understanding your question since you didnt complete the last part of question.
I assume that you meant as same dimension as that of distance.
now;
in 1/2 gt^2 , 1/2 is irrelavant dimensionwise. so lets skip that.
g has same dimension as that of accelaration . ie m/s^2 = [LT^-2]
now ;
the dimension of time^2 is [T^2]
so overall dimension of 1/2 gt^2 becomes = [ LT^-2 *T^2]
ie ;
= [L]
this is same dimension as that of distance.
Hope this helps.