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

bubblesort Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

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

bubblesort.html

Infocomm club members visit Koi frequently after CCA meetings. Koi is a popular bubble tea outlet which sells tea with pearls (or bubbles).

One day, while enjoying Koi, Kenneth Chow decided to sort the bubbles in his mouth by their diameter. However, since it is hard to think when there's something inside your mouth. He asked you for help. Being a C++ freak, you wanted to code a program to do Bubble Sort.

Input

The first line of input is n, which is the number of bubbles Kenneth has in his mouth.
Kenneth has a big mouth, which can hold up to 2000 bubbles.
The next line consists of n space separated numbers, representing the diameter of the bubbles in Kenneth's mouth.

Output

Sort the list of diameters and print them out in ascending order, space-separated.

Sample Input

10
5 8 2 3 7 4 9 7 1 2

Sample Output

1 2 2 3 4 5 7 7 8 9

*There is no extra space behind the last number of the output*

Tags

Sorting

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1100101s32MBAverage
2011s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o bubblesort -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.