Assigning XP to Party: To Split or Not to Split?
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.
Note, it's not just surviving characters that get a share, since the word 'surviving' was in the question. Characters that die also get their share of the exp posthumously.
@Aviose That is true, the DMG never states PCs or NPCs must survive, only that they provide substantial assistance. Will clarify
@SevenSidedDie They have given "substantial assistance" to the encounter and the defeat of the creature, if for no other reason than by absorbing a hit or two from a potentially (and apparently) lethal creature. They helped in the fight, and they learned something (although they will need resurrected to use that lesson).
@SevenSidedDie The Wizard nukes the horde of orcs, leaving them each with 1 hit point. Promptly gets killed in retaliation. Then the party mops up. I'd say the party "received substantial assistance from" the wizard. He earned a share of the XP. He just didn't survive to make use of it.
@Zeroah I would state that by nature of being a PC, you are assumed to be providing that "substantial assistance", but that does leave a tiny bit of room for interpretation, I suppose.
@Aviose The DMG only gives the "substantial assistance" clause to NPCs, so yes I would assume that is the case. Will edit
Should it work the same when it comes to non combat encounters? - For example: Party encounters trapped statue with mechanism that opens door to secret room with treasure. Only one player decides to investigate and eventually untrap and manipulate the statue to get to the reward without needing help from others who get to wait for him till he is done. It would make sense to give experience for removing trap and finding the room only to the chracter who went trough all the trouble to get it solved. Or am I wrong?
@pppddd that's probably why the "substantial assistance" clause only applies to NPCs. Face it, in a "traditional" party, at most two of the four CAN help in a trap situation. I get that 5e isn't quite as hidebound in its roles for each party member and such, but really, if you can find a non-combat situation the entire party is near-equally proficient at handling, then your entire party is the same class. You shouldn't punish the Fighter for taking the class that's primarily useful in combat; the Rogue needs him up front to soak those hits so she can live long enough to reach the traps.