1477 - 電機系 (呂老師) DS 上機考5 Scoreboard

Time

2018/06/04 18:35:00 2018/06/04 20:35:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11944 (電機系呂老師班上機考) Partition Step of QuickSort

11944 - (電機系呂老師班上機考) Partition Step of QuickSort   

Description

  • Given
    • List of distinct integers
    • Required order: ascending (由小到大) or descending (由大到小)
      • 測資 1~6 是 ascending (由小到大),佔120%
      • 測資 7~8 是 descending (由大到小),佔40%
      • 測資 1 就是 sample input/output
  • Perform the partition step of QuickSort once
    • Use the last number as the pivot
    • Do swaps to partition the list according to the pivot
    • Print out the list
  • Ascending (由小到大) Example
  • Descending (由大到小)  Example

 

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss