Given a list of sensor readings from multiple UAVs, return the top k devices with the highest anomaly scores.
Implement top_k_anomalous_devices(readings, k). Each reading is a dictionary with a unique string device_id and numeric anomaly_score. Return the device IDs ordered from highest score to lowest; ties may appear in any order. Use an algorithm better than sorting the entire input when k is much smaller than the number of readings.
def top_k_anomalous_devices(readings, k):