The key to the problem may be that the computer that can get IP is a notebook. It has logged into the library before, and its MAC address has been recorded by the server. When it returns to the dormitory, it will automatically find the server it logged in last time and continue to use the IP used in the library, so it can be successful. Of course, other computers automatically get the IP you logged in last time, and these IPS just need money.
It is also possible that the IP number assigned to the library will be assigned to your dormitory if there is any surplus at that time. This possibility is relatively small.