I try to make a point of being one of the first 10 people in shul. Sometimes, before shmone esrei I need to leave the shul to use the facilities (there will remain a minyan in the shul without me). Do I lose the schar of the being the one of the first 10?
If you are davening shemon esrei with the minyan you will not lose the sechar of asara rishonim, but if you don’t daven with them, then you would.
Sulchan Aruch O:Ch 90-14, M:B ibid 47.