13068 - Dynamic Programming   

Description

This is a partial judge problem OwO

You are given N integers. You need to sort them in decreasing order.

Partial Code

main.c

#include<stdio.h>
#include<stdlib.h>
#include "function.h"
#define maxn 100005
int arr[maxn];
int main() {
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&arr[i]);
    qsort(arr+1, n, sizeof(int),cmp);
    for(int i=1;i<=n;i++) {
        if(i != 1)	printf(" ");
        printf("%d",arr[i]);
    }
    printf("\n");
    return 0;
}

function.h

int cmp(const void*, const void*);

You need to implement the cmp function which is the fourth parameter of the qsort function in main function.

Input

The first line contains one integer (1 ≤ N ≤ 105) – the number of integers you are given.

The second line contains N integers a1a2, ..., aN (1 ≤ ai ≤ 105).

Output

Ouput the given N integers in decreasing order.

Sample Input  Download

Sample Output  Download

Partial Judge Code

13068.c

Partial Judge Header

13068.h

Tags




Discuss