Semiempirical Study of Metastable Alloys Obtained by Ion Implantation in Metals and Semiconductors