The ccp lattice is formed by the element Y.
The number of octahedral voids generated would be equal to the number of atoms of Y present in it.
Since all the octahedral voids are occupied by the atoms of X, their number would also be equal to that of the element Y. Thus, the atoms of elements X and Y are present in equal numbers or 1:1 ratio.
Therefore, the formula of the compound is XY.
Hence (A) is the correct answer.