Sắp xếp nhanh

View as PDF

Submit solution

Points: 200.00 (partial)
Time limit: 1.0s
Memory limit: 1G
Input: stdin
Output: stdout

Author:
Problem type
Allowed languages
C, C++, GAS64, Pascal, Perl, PHP, Python, Sed, TCL, Text

Cho số nguyên dương n và dãy số nguyên a1,a2,…,an. Hãy sắp xếp dãy số tăng dần theo giá trị.

Dữ liệu vào:

  • Dòng đầu ghi số nguyên dương n.
  • Dòng thứ hai ghi n số nguyên lần lượt là a1,a2,…,an

Giới hạn:

  • 1n105
  • |ai|109

Kết quả: Dãy số a1,a2,…,an sau khi sắp xếp tăng dần

Ví dụ:
Input 1:
Copy
6
1 4 2 3 6 5
Output 1:
Copy
1 2 3 4 5 6

Comments

Please read the guidelines before commenting.



  • -1
    anhtuan2007  commented 10:29:19 am, 27/08/2022

    Watson is my life