stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

using namespace std;



int arr[2000100], c[100001], ans[2000100];



int main()

{

    int i, n;

    scanf("%d", &n);



        memset(c, 0, sizeof(c));



        for(i = 1; i <= n; ++i)

        {

            scanf("%d", &arr[i]);

            ++c[arr[i]];

        }



        for(i = 1; i < 100001; ++i)

            c[i] = c[i] + c[i - 1];



        for(i = n; i > 0; --i)

        {

            ans[c[arr[i]]] = arr[i];

            --c[arr[i]];

        }



        for(i = 1; i < n; ++i)

            printf("%d ", ans[i]);

            printf("%d\n", ans[n]);



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4716945520899345x):
#include<iostream>

#include<stdlib.h>

#include<string.h>

#include<stdio.h>

#define max 2000001

#define vmax 10000

using namespace std;



int main()

{

	unsigned short *a,*b;

	

	int c[vmax+1];

	int n,i,j;

	scanf("%d",&n);

	

	memset(c,0,sizeof(c));

	a=(unsigned short *)malloc(sizeof(short)*n+1);

	b=(unsigned short *)malloc(sizeof(short)*n+1);

	for(i=0;i<n;i++)

	{

		scanf("%hu",&a[i+1]);

		c[a[i+1]]++;

	}

	for(i=1;i<=vmax;i++)

	    c[i]=c[i]+c[i-1];

	for(j=1;j<=n;j++)

	{

		b[c[a[j]]]=a[j];

		c[a[j]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1) printf(" ");

		printf("%hu",b[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int a[2000007];



int main()

{

    int n;

    cin>>n;

    for(int i=0;i<n;i++)

        cin>>a[i];



    sort(a,a+n);

    for(int i=0;i<n;i++)

        (i)?printf(" %d",a[i]):

            printf("%d",a[i]);

    printf("\n");





}

// Faster C++ solution for the same problem (measured speedup: 5.166767790787148x):
#include<stdio.h>

#include<fstream>

#include<algorithm>

using namespace std;

int a[2000005];

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    sort(a,a+n);

    for(int i=0;i<n;i++)

    {

        if(i) printf(" ");

        printf("%d",a[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int arr[10001];

int main()

{

    int cs=0;



    {

        int n;

       scanf("%d",&n);





    memset(arr,0,sizeof(arr));



        for(int i=0;i<n;i++)

        {

            int a;

            scanf("%d",&a);

        arr[a]++;



        }

        }



    int i=0;

        for( i=0;i<10001;i++)

        {

            if(arr[i]>0){



           printf("%d",i);

           arr[i]--;



           break;

            }







        }

 for(int j=0;j<10001;j++)

        {

            if(arr[j]>0){

                    for(int k=1;k<=arr[j];k++)

           printf(" %d",j);

            }







        }





printf("\n");









    }

// Faster C++ solution for the same problem (measured speedup: 5.400385963322637x):
#include<stdio.h>

#include<fstream>

#include<algorithm>

using namespace std;

int a[2000005];

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    sort(a,a+n);

    for(int i=0;i<n;i++)

    {

        if(i) printf(" ");

        printf("%d",a[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int ara[20000];

int main()

{

    int n ;

    cin >> n;

    for(int i = 0; i<n; i++)

    {

        int a;

        cin >> a;

        ara[a]++;

    }

    int f = 0;

    for(int i = 0; i<10007; i++)

        while(ara[i]--){

            if(f) printf(" ");

            cout << i ;

            f = 1;

        }

    cout << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.451960597680916x):
#include<stdio.h>

#include<fstream>

#include<algorithm>

using namespace std;

int a[2000005];

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    sort(a,a+n);

    for(int i=0;i<n;i++)

    {

        if(i) printf(" ");

        printf("%d",a[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int main()

{



int ns[10001];



for(int i=0;i<10001;i++)

{

    ns[i]=0;

}



int n;

scanf("%d",&n);



int d;

for(int i=0;i<n;i++)

{

    scanf("%d",&d);

    ns[d]++;

}



int frst=1;



for(int i=0;i<10001;i++)

{

    if(ns[i]!=0)

    {

        for(int j=0;j<ns[i];j++)

        {

            if(!frst){printf(" ");}

            else{frst=0;}

            printf("%d",i);

        }

    }

}



printf("\n");



return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.377673314285443x):
#include<stdio.h>

#include<fstream>

#include<algorithm>

using namespace std;

int a[2000005];

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    sort(a,a+n);

    for(int i=0;i<n;i++)

    {

        if(i) printf(" ");

        printf("%d",a[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;

int arra[10001];

int main()



{

    int n,temp,j,mini;

    scanf("%d",&n);

    int ara[n];

    for(int i=0;i<n;i++)

    {

        scanf("%d",&ara[i]);

        arra[ara[i]]++;

    }

    int frst=1;

    for(int i=0;i<10001;i++)

    {

        if(arra[i]!=0)

        {

            for(j=0;j<arra[i];j++)

            {





            if(!frst)

            {

                printf(" ");

            }

            else

            {

                frst=0;

            }

             printf("%d",i);

        }

    }

    }

    cout<<endl;







}

// Faster C++ solution for the same problem (measured speedup: 5.373966951846187x):
#include<stdio.h>

#include<fstream>

#include<algorithm>

using namespace std;

int a[2000005];

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    sort(a,a+n);

    for(int i=0;i<n;i++)

    {

        if(i) printf(" ");

        printf("%d",a[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

using namespace std;



int arr[2000100], c[100001], ans[2000100];



int main()

{

    int i, n;

    scanf("%d", &n);



        memset(c, 0, sizeof(c));



        for(i = 1; i <= n; ++i)

        {

            scanf("%d", &arr[i]);

            ++c[arr[i]];

        }



        for(i = 1; i < 100001; ++i)

            c[i] = c[i] + c[i - 1];



        for(i = n; i > 0; --i)

        {

            ans[c[arr[i]]] = arr[i];

            --c[arr[i]];

        }



        for(i = 1; i < n; ++i)

            printf("%d ", ans[i]);

            printf("%d\n", ans[n]);



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 7.927723996875028x):
#include<stdio.h>

#include<fstream>

#include<algorithm>

using namespace std;

int a[2000005];

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    sort(a,a+n);

    for(int i=0;i<n;i++)

    {

        if(i) printf(" ");

        printf("%d",a[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdlib.h>

#include<string.h>

#include<stdio.h>

#define max 2000001

#define vmax 10000

using namespace std;



int main()

{

	unsigned short *a,*b;

	

	int c[vmax+1];

	int n,i,j;

	scanf("%d",&n);

	

	memset(c,0,sizeof(c));

	a=(unsigned short *)malloc(sizeof(short)*n+1);

	b=(unsigned short *)malloc(sizeof(short)*n+1);

	for(i=0;i<n;i++)

	{

		scanf("%hu",&a[i+1]);

		c[a[i+1]]++;

	}

	for(i=1;i<=vmax;i++)

	    c[i]=c[i]+c[i-1];

	for(j=1;j<=n;j++)

	{

		b[c[a[j]]]=a[j];

		c[a[j]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1) printf(" ");

		printf("%hu",b[i]);

	}

	printf("\n");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.386799853010919x):
#include<stdio.h>

#include<fstream>

#include<algorithm>

using namespace std;

int a[2000005];

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    sort(a,a+n);

    for(int i=0;i<n;i++)

    {

        if(i) printf(" ");

        printf("%d",a[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

using namespace std;



int arr[2000100], c[100001], ans[2000100];



int main()

{

    int i, n;

    scanf("%d", &n);



        memset(c, 0, sizeof(c));



        for(i = 1; i <= n; ++i)

        {

            scanf("%d", &arr[i]);

            ++c[arr[i]];

        }



        for(i = 1; i < 100001; ++i)

            c[i] = c[i] + c[i - 1];



        for(i = n; i > 0; --i)

        {

            ans[c[arr[i]]] = arr[i];

            --c[arr[i]];

        }



        for(i = 1; i < n; ++i)

            printf("%d ", ans[i]);

            printf("%d\n", ans[n]);



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.5285109193500854x):
#include<iostream>

#include<algorithm>

using namespace std;

int main()

{

   int n;

   cin>>n;

   int a[n];

   for(int i=0;i<n;i++)

   {

      cin>>a[i];

   }

   sort(a,a+n);

   for(int i=0;i<n;i++)

   {

      if(i>0)

         cout<<" ";

      cout<<a[i];

   }

   cout<<endl;

   return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

using namespace std;



int arr[2000100], c[100001], ans[2000100];



int main()

{

    int i, n;

    scanf("%d", &n);



        memset(c, 0, sizeof(c));



        for(i = 1; i <= n; ++i)

        {

            scanf("%d", &arr[i]);

            ++c[arr[i]];

        }



        for(i = 1; i < 100001; ++i)

            c[i] = c[i] + c[i - 1];



        for(i = n; i > 0; --i)

        {

            ans[c[arr[i]]] = arr[i];

            --c[arr[i]];

        }



        for(i = 1; i < n; ++i)

            printf("%d ", ans[i]);

            printf("%d\n", ans[n]);



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4115394503664838x):
#include<iostream>

#include<cstdio>

#include<cstring>

using namespace std;

int c[20000+200];

int a[3000000+200];

int n;



void countSort(){

    memset(c,0,sizeof(c));

    for(int i=0;i<n;i++){

        c[a[i]]++;

    }

    int index=0;

    for(int i=0;i<10000+10;i++){

        while(c[i]){

            a[index++]=i;

            c[i]--;

        }

        if(index==n)

            break;

    }

    printf("%d",a[0]);

    for(int i=1;i<n;i++){

        printf(" %d",a[i]);

    }

    cout<<endl;

    return;

}



int main(){

    cin>>n;

    for(int i=0;i<n;i++){

        scanf("%d",&a[i]);

    }

    countSort();

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

using namespace std;



int arr[2000100], c[100001], ans[2000100];



int main()

{

    int i, n;

    scanf("%d", &n);



        memset(c, 0, sizeof(c));



        for(i = 1; i <= n; ++i)

        {

            scanf("%d", &arr[i]);

            ++c[arr[i]];

        }



        for(i = 1; i < 100001; ++i)

            c[i] = c[i] + c[i - 1];



        for(i = n; i > 0; --i)

        {

            ans[c[arr[i]]] = arr[i];

            --c[arr[i]];

        }



        for(i = 1; i < n; ++i)

            printf("%d ", ans[i]);

            printf("%d\n", ans[n]);



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.547295417425487x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int x;

    scanf("%d",&x);

    int arr[x+1];

    for(int i=0;i<x;i++)

        scanf("%d",&arr[i]);

    sort(arr,arr+x);

    for(int i=0;i<x;i++)

    {

        if(i==x-1)

            printf("%d\n",arr[i]);

        else

            printf("%d ",arr[i]);

    }

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

using namespace std;



int arr[2000100], c[100001], ans[2000100];



int main()

{

    int i, n;

    scanf("%d", &n);



        memset(c, 0, sizeof(c));



        for(i = 1; i <= n; ++i)

        {

            scanf("%d", &arr[i]);

            ++c[arr[i]];

        }



        for(i = 1; i < 100001; ++i)

            c[i] = c[i] + c[i - 1];



        for(i = n; i > 0; --i)

        {

            ans[c[arr[i]]] = arr[i];

            --c[arr[i]];

        }



        for(i = 1; i < n; ++i)

            printf("%d ", ans[i]);

            printf("%d\n", ans[n]);



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.495126353980322x):
#include <iostream>

#include <vector>

#include <string>

#include <set>

#include <cstdio>

#include <cstring>

#include <queue>

#include <stack>

#include <algorithm>

#include <cmath>

#define ll long long

#define INF 0x3f3f3f3f

#define SIS std::ios::sync_with_stdio(false)

using namespace std;



int main()

{

    SIS;

    int n;

    while(cin>>n)

    {

        vector <int> s;

        int num;

        for(int i=0;i<n;i++)

        {

            cin>>num;

            s.push_back(num);

        }

        sort(s.begin(),s.end());

        for(int i=0;i<n;i++)

            if(i==0)

                cout<<s[i];

            else

                cout<<" "<<s[i];

        cout<<endl;

    }

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

using namespace std;



int arr[2000100], c[100001], ans[2000100];



int main()

{

    int i, n;

    scanf("%d", &n);



        memset(c, 0, sizeof(c));



        for(i = 1; i <= n; ++i)

        {

            scanf("%d", &arr[i]);

            ++c[arr[i]];

        }



        for(i = 1; i < 100001; ++i)

            c[i] = c[i] + c[i - 1];



        for(i = n; i > 0; --i)

        {

            ans[c[arr[i]]] = arr[i];

            --c[arr[i]];

        }



        for(i = 1; i < n; ++i)

            printf("%d ", ans[i]);

            printf("%d\n", ans[n]);



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.4642881735260742x):
#include <bits/stdc++.h>

using namespace std;



int n,a[2000001],freq[100100];



void countingsort(int a[]){

    for(int i=1;i<=n;i++){

        freq[a[i]]++;

    }

    int idx=0;

    for(int i=0;i<=10000;i++){

        for(int j=1;j<=freq[i];j++){

            idx++;

            a[idx]=i;

        }

    }

}



int main(){

    cin>>n;

    for(int i=1;i<=n;i++){

        cin>>a[i];

    }

    countingsort(a);

    for(int i=1;i<=n;i++){

        cout<<a[i];

        if(i==n){

            cout<<endl;

        }else{

            cout<<" ";

        }

    }

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int a[2000007];



int main()

{

    int n;

    cin>>n;

    for(int i=0;i<n;i++)

        cin>>a[i];



    sort(a,a+n);

    for(int i=0;i<n;i++)

        (i)?printf(" %d",a[i]):

            printf("%d",a[i]);

    printf("\n");





}

// Faster C++ solution for the same problem (measured speedup: 4.1103420411957785x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

		C[i]=C[i]+C[i-1];

	}

	for(i=0;i<n;i++)

	{

		B[C[A[i]]]=A[i];

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int arr[10001];

int main()

{

    int cs=0;



    {

        int n;

       scanf("%d",&n);





    memset(arr,0,sizeof(arr));



        for(int i=0;i<n;i++)

        {

            int a;

            scanf("%d",&a);

        arr[a]++;



        }

        }



    int i=0;

        for( i=0;i<10001;i++)

        {

            if(arr[i]>0){



           printf("%d",i);

           arr[i]--;



           break;

            }







        }

 for(int j=0;j<10001;j++)

        {

            if(arr[j]>0){

                    for(int k=1;k<=arr[j];k++)

           printf(" %d",j);

            }







        }





printf("\n");









    }

// Faster C++ solution for the same problem (measured speedup: 4.296193357733009x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

		C[i]=C[i]+C[i-1];

	}

	for(i=0;i<n;i++)

	{

		B[C[A[i]]]=A[i];

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int ara[20000];

int main()

{

    int n ;

    cin >> n;

    for(int i = 0; i<n; i++)

    {

        int a;

        cin >> a;

        ara[a]++;

    }

    int f = 0;

    for(int i = 0; i<10007; i++)

        while(ara[i]--){

            if(f) printf(" ");

            cout << i ;

            f = 1;

        }

    cout << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.337222758791081x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

		C[i]=C[i]+C[i-1];

	}

	for(i=0;i<n;i++)

	{

		B[C[A[i]]]=A[i];

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



int main()

{



int ns[10001];



for(int i=0;i<10001;i++)

{

    ns[i]=0;

}



int n;

scanf("%d",&n);



int d;

for(int i=0;i<n;i++)

{

    scanf("%d",&d);

    ns[d]++;

}



int frst=1;



for(int i=0;i<10001;i++)

{

    if(ns[i]!=0)

    {

        for(int j=0;j<ns[i];j++)

        {

            if(!frst){printf(" ");}

            else{frst=0;}

            printf("%d",i);

        }

    }

}



printf("\n");



return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.278124661792973x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

		C[i]=C[i]+C[i-1];

	}

	for(i=0;i<n;i++)

	{

		B[C[A[i]]]=A[i];

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;

int arra[10001];

int main()



{

    int n,temp,j,mini;

    scanf("%d",&n);

    int ara[n];

    for(int i=0;i<n;i++)

    {

        scanf("%d",&ara[i]);

        arra[ara[i]]++;

    }

    int frst=1;

    for(int i=0;i<10001;i++)

    {

        if(arra[i]!=0)

        {

            for(j=0;j<arra[i];j++)

            {





            if(!frst)

            {

                printf(" ");

            }

            else

            {

                frst=0;

            }

             printf("%d",i);

        }

    }

    }

    cout<<endl;







}

// Faster C++ solution for the same problem (measured speedup: 4.27517612259577x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

		C[i]=C[i]+C[i-1];

	}

	for(i=0;i<n;i++)

	{

		B[C[A[i]]]=A[i];

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <cmath>

#include <cstring>

using namespace std;



int arr[2000100], c[100001], ans[2000100];



int main()

{

    int i, n;

    scanf("%d", &n);



        memset(c, 0, sizeof(c));



        for(i = 1; i <= n; ++i)

        {

            scanf("%d", &arr[i]);

            ++c[arr[i]];

        }



        for(i = 1; i < 100001; ++i)

            c[i] = c[i] + c[i - 1];



        for(i = n; i > 0; --i)

        {

            ans[c[arr[i]]] = arr[i];

            --c[arr[i]];

        }



        for(i = 1; i < n; ++i)

            printf("%d ", ans[i]);

            printf("%d\n", ans[n]);



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 6.306777961544058x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

		C[i]=C[i]+C[i-1];

	}

	for(i=0;i<n;i++)

	{

		B[C[A[i]]]=A[i];

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdlib.h>

#include<string.h>

#include<stdio.h>

#define max 2000001

#define vmax 10000

using namespace std;



int main()

{

	unsigned short *a,*b;

	

	int c[vmax+1];

	int n,i,j;

	scanf("%d",&n);

	

	memset(c,0,sizeof(c));

	a=(unsigned short *)malloc(sizeof(short)*n+1);

	b=(unsigned short *)malloc(sizeof(short)*n+1);

	for(i=0;i<n;i++)

	{

		scanf("%hu",&a[i+1]);

		c[a[i+1]]++;

	}

	for(i=1;i<=vmax;i++)

	    c[i]=c[i]+c[i-1];

	for(j=1;j<=n;j++)

	{

		b[c[a[j]]]=a[j];

		c[a[j]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1) printf(" ");

		printf("%hu",b[i]);

	}

	printf("\n");

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.28538513823258x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

		C[i]=C[i]+C[i-1];

	}

	for(i=0;i<n;i++)

	{

		B[C[A[i]]]=A[i];

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

using namespace std;

int main()

{

   int n;

   cin>>n;

   int a[n];

   for(int i=0;i<n;i++)

   {

      cin>>a[i];

   }

   sort(a,a+n);

   for(int i=0;i<n;i++)

   {

      if(i>0)

         cout<<" ";

      cout<<a[i];

   }

   cout<<endl;

   return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.126092840884425x):
#define MAX 2000001

#define VMAX 10001

#include <stdio.h>





int A[MAX], C[VMAX], B[MAX];



int main()//被排序的数至少有一个，所以B数组中的数统一向后移动一位 

{

	int n, i, j;

	scanf("%d", &n);

	for(i=0;i<n;i++)

	{

		scanf("%d", &A[i]);

	}

	for(i=0;i<n;i++)

	{

		C[A[i]]++;

	}

	for(i=1;i<=VMAX;i++)

	{

		C[i]=C[i]+C[i-1];

	}

	for(i=0;i<n;i++)

	{

		B[C[A[i]]]=A[i];

		C[A[i]]--;

	}

	for(i=1;i<=n;i++)

	{

		if(i>1)

		{

			printf(" ");

		}

		printf("%d", B[i]);

	}

	printf("\n");

	return 0;

}