Neutron-capture elements in halo, thick-disk, and thin-disk stars. Strontium, yttrium, zirconium, cerium