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 def main(): data = sys.stdin.read().split() n = int(data[0]) xys = list(map(int, data[1:])) points = list(zip(xys[::2], xys[1::2])) points.sort() for x, y in points: print(x, y) if __name__ == "__main__": main()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.