Cho bảng task code, priority, deadline_days. Sắp xếp theo: (1) priority với thứ tự HIGH < MED < LOW (dùng key=lambda s: s.map({'HIGH':0,'MED':1,'LOW':2})); (2) deadline_days tăng dần; (3) code theo số cuối (ví dụ T7 < T10) — dùng key=lambda s: s.str.extract(r'(\d+)$', expand=False).astype(int). Mẹo: chain các stable sort theo thứ tự ngược (chính cuối).
Dòng 1: n. n dòng: code,priority,deadline_days. Mỗi code có dạng chữ + số (ví dụ T1, TASK42).
1 <= n <= 100.
Các dòng code priority deadline_days.
Ví dụ:
Đầu vào:
5
T2,HIGH,5
T10,HIGH,5
T3,LOW,1
T1,MED,2
T7,HIGH,3
Đầu ra:
T7 HIGH 3
T2 HIGH 5
T10 HIGH 5
T1 MED 2
T3 LOW 1
Giải thích:
Đang tải editor...