The compression is given as,
mgh=12kx2
1×10×5=12×50×x2
x=1.414m
Thus, the compression in the spring is 1.414m.