Total XP is divided amongst the players participating in the combat
Dungeon Master's Guide (1st printing, pg. 260):
When adventurers defeat one or more monsters-typically by killing, routing, or capturing them-they divide the total XP value of the monsters evenly amongst themselves. If the party received substantial assistance from one or more NPCs, count those NPCS as party members when dividing up the XP.
This rewards players based on the relative difficulty of the combat rather than the empirical size of the opposition. 10 goblins is more of a challenge to 4 players than to 10 players for instance, thus each player gets a larger piece of the XP. Otherwise an army of player characters could amass absurd XP from swarming a high CR monster and all benefit as if they had single handedly taken it down.
In terms of survival, the DMG never distinguishes between alive or dead combatants for XP division. Thus XP is divided amongst the living and dead with no differentiation. By nature of being a PC, players are considered as providing "substantial assistance" regardless of their actions (so long as they participate in the combat). Survival has no affect for NPCs that provided "substantial assistance" and are still rewarded XP accordingly if killed.
Thus, each player, in your example of four players, would receive 100XP in 400XP combat whether they survive to the end of combat or not.