Race Results
InterviewTime limit1sMemory limit128 MB
Sort N finish times given as hours, minutes, and seconds in ascending order and print each on its own line.
- Level
Easy3 of 10
- Topics
- Sorting, Implementation
- Solved
- No attempts yet
Problem
The herd has finished its first marathon! You are given finish times, each written as Hours , Minutes , and Seconds (, , , ).
Sort these times in ascending order — comparing by hours, then minutes, then seconds, with the smallest (fastest) time first — and print them.
Input
- Line 1: a single integer .
- Lines 2 through : line contains the -th cow's time as three space-separated integers: hours, minutes, and seconds.
Output
- lines: each line contains one cow's time as three space-separated integers (hours, minutes, seconds), printed in ascending sorted order.