Any Pokemon that gets any EXP from a battle gets the base number of EV's.
Pokemon #1 = battling a Bidoof (1 hp ev)
Pokemon #2 = Exp share (1hp ev)
Pokemon #3 = Exp share (1hp ev)
Pokemon #4 = Exp share (1hp ev)
Pokemon #5 = Exp share (1hp ev)
Pokemon #6 = Exp share (1hp ev)
this is one of the most extreme circumstances and it still works.