Odd-frequency superconductivity in dilute magnetic superconductors