oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

multisort Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

multisort.html

Sorting is a subroutine in many algorithms. For example, before we perform Graham's convex hull algorithm, we need to first sort the points by their polar angles.

In this problem, you will read in a list of list of numbers. You have to sort each list individually, then sort the list of lists.

Input

First line of input will be two integers, N and M. You may assume N and M are both smaller than 200.

Following that, each of the next N lines will contain the list of M numbers.

Output

Output the list of list of numbers, in ascending order of the list, where each list has its numbers in ascending order.

Sample Input 1

3 3
1 1 2
3 2 1
2 3 4

Sample Output 1

1 1 2
1 2 3
2 3 4

Tags

Sorting

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110051s32MBAverage
2011s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o multisort -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.