report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Points Sorting - FlandreOJ: Flandre Online Judge

Points Sorting

Time limit: 1000 ms
Memory limit: 256 MB
There are $n$ integer points $(x, y, z)$ on a 3D coordinate system. Sort them in ascending order by $x$, then by $y$ (if points have the same value of $x$), and then by $z$ (if points have the same value of $x$ and $y$). ### Input - The first line contains an integer $n$. - Each line in the next $n$ lines contains 3 integers $x, y, z$. ### Output - Print $n$ points after sorting. ### Constraints - $1 \le n \le 100000$. - $1 \le x, y, z \le 10^9$. ### Example Input: ``` 3 3 4 3 2 4 3 2 1 6 ``` Output: ``` 2 1 6 2 4 3 3 4 3 ```
Sorting
Points Sorting
Brewing potion
Smallest possible
Distance minimization
Segment
Cucumber
Maximum value arrangement
Buttons game
Building fence
Balance
Topic
Sorting
Rating 800
Solution (2) Solution