Concept:
When a floating body is displaced slightly and released, the change in buoyant force acts as a restoring force. The body executes Simple Harmonic Motion (SHM).
For a floating body,
\[
T=2\pi\sqrt{\frac{m}{\rho A g}}
\]
where
\[
m=\text{mass of floating body}
\]
\[
\rho=\text{density of liquid}
\]
\[
A=\text{cross-sectional area}
\]
\[
g=\text{acceleration due to gravity}
\]
Step 1: Calculate the cross-sectional area of the cube.
Side of cube:
\[
a=10\text{ cm}=0.1\text{ m}
\]
Therefore,
\[
A=a^2=(0.1)^2
\]
\[
A=0.01\text{ m}^2
\]
Step 2: Substitute the known quantities in the SHM formula.
Given:
\[
T=0.5\text{ s}
\]
\[
\rho=1000\text{ kg m}^{-3}
\]
\[
g=10\text{ ms}^{-2}
\]
Using
\[
T=2\pi\sqrt{\frac{m}{\rho Ag}}
\]
\[
0.5=2\pi\sqrt{\frac{m}{1000\times0.01\times10}}
\]
\[
0.5=2\pi\sqrt{\frac{m}{100}}
\]
Squaring both sides,
\[
0.25=4\pi^2\frac{m}{100}
\]
\[
m=\frac{25}{4\pi^2}
\]
Using
\[
\pi^2\approx 10
\]
\[
m\approx\frac{25}{40}
\]
\[
m=0.625\text{ kg}
\]
\[
m=625\text{ g}
\]
Step 3: Final answer.
\[
\boxed{625\text{ g}}
\]