Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # TỪ ĐIỂN LỒNG NHAU
- n,k=map(int,input().split())
- if (n>70) or k>5: print("INVALID INPUT")
- else:
- res={}
- for i in range(n):
- a,b=map(str,input().split())
- b=int(b)
- res[a]=b
- ans = sorted(res.items(), key=lambda x:(-x[1],x[0]))
- for i in range(k):
- print(ans[i][0],end=" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement