Write a program which print coordinates $(xi, yi)$ of given $n$ points on the plane by…
- User
Write a program which print coordinates of given points on the plane by the following criteria.
- first by -coordinate
Assistant
import sys n = int(sys.stdin.readline()) points = [tuple(map(int, sys.stdin.readline().split())) for _ in range(n)] points.sort(key=lambda p: (p[0], p[1])) print('\n'.join(f"{x} {y}" for x, y in points))
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.