Topology Optimization of Random Memristors for Input-Aware Dynamic SNN