Jelly, 2424 22 bytes
aŻƤSƇḢßoɓ@ooƑ?
Ṭ×),o,aŻƤSƇḢʋɗ@/oƑ/¿Sɗƒ0ç@ƒ0
I still have the strangest feeling that something closer to Dennis's answer should beat this, but I haven't had any luck with that so far. I have twisted the first line into something that sounds like some kind of exploding can (from my original recursive solution; I thought it saved a byte but I didn't look at the output too carefully so it actually ties but it does look funnier).
) aŻƤSƇḢßoɓ@ooƑ? Helper link: add a pre-positioned guest to the hotel
For each guest value,
Ṭɓ With reversed arguments (hotel left, guest right):
oƑ? obtain a list ofUnless allboth zeroesarrays thenhave a onenonzero at thatthe indexsame location,
× o and multiply thatreturn bywith the same guest value.
placed in its empty room;
ɓ ɗƒ0 Starting with 0, reduceif thatthey bydo:
, @ (guest left, hotel right)
a Pair the accumulator with the guest.
Overlay the guest's zeroes on the hotel.
ŻƤ oƑ/¿ While both paired arrays have aPrepend nonzeroanother atzero theto sameeach locationprefix,
SƇḢ ɗ@/ and lettake the first be on the right and the second onwith thea leftnonzero of:sum.
o ß Call this link again with that overlayas the left's nonzero value on thenew right,guest
, ʋ o and pair that with:
athe hotel having the previous guest replace the new one.
Ṭ×)ç@ƒ0 Main link
) overlay the left's zeroesFor oneach theguest rightvalue,
ŻƤ Ṭ obtain a list of all zeroes prependthen anothera zeroone toat eachthat prefixindex,
SƇḢ × and takemultiply thethat firstby withthe asame nonzeroguest sumvalue.
ƒ0 Starting with 0, Sreduce that by
ç@ After the loop, sum the corresponding elementshelper ofwith eachreversed arrayarguments.
Essentially just boots occupants out of their rooms in sequence until there's no collision, considering a new guest as equivalent to someone evicted from the last room they can't start in. A nice recursive formulation should beat than this pair-loop-reduce hack, but I'm struggling to pull it off.