Perfect Associative Learning with Spike-Timing-Dependent Plasticity