Hundreds arriving to hospital by ambulance had to wait for more than an hour before getting a bed