// BucketSort
#include <stdio.h>
#include <stdlib.h>
void printA(int a[], int n){
int i;
for(i=0;i<n;i++){
}
}
void swap(int* a, int* b){
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
#define MAX 1000000
void BucketSort(int a[], int n){
int i, t;
int b[MAX];
t=0;
for(i=0; i<MAX; i++){
b[i]=0;
}
for(i=0; i<n; i++){
b[a[i]]=a[i];
}
for(i=0; i<MAX; i++){
if(b[a[i]]==a[t]){
swap(&b[a[i]],&a[t]);
}
t++;
}
}
int main(void){
int n,i;
int *v;
v
= (int*)malloc(sizeof(int)*n
); if(v==NULL){
return -1;
}
for(i=0;i<n;i++){
}
BucketSort(v,n);
printA(v,n);
return 0;
}
Ly8gQnVja2V0U29ydAojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPgoKdm9pZCBwcmludEEoaW50IGFbXSwgaW50IG4pewogICAgaW50IGk7CiAgICBmb3IoaT0wO2k8bjtpKyspewogICAgICAgIHByaW50ZigiJWQgIixhW2ldKTsKICAgIH0KICAgIHByaW50ZigiXG4iKTsKfQoKdm9pZCBzd2FwKGludCogYSwgaW50KiBiKXsKICAgIGludCAgdG1wOwogICAgdG1wID0gKmE7CiAgICAqYSA9ICpiOwogICAgKmIgPSB0bXA7Cn0KCiNkZWZpbmUgTUFYIDEwMDAwMDAKdm9pZCBCdWNrZXRTb3J0KGludCBhW10sIGludCBuKXsKICAgaW50IGksIHQ7CiAgICBpbnQgYltNQVhdOwogICAgdD0wOwpmb3IoaT0wOyBpPE1BWDsgaSsrKXsKYltpXT0wOwoJCX0KZm9yKGk9MDsgaTxuOyBpKyspewpiW2FbaV1dPWFbaV07CgkJfQpmb3IoaT0wOyBpPE1BWDsgaSsrKXsKaWYoYlthW2ldXT09YVt0XSl7CgkJc3dhcCgmYlthW2ldXSwmYVt0XSk7CgkJCQl9CgkJdCsrOwoJCX0KCX0KaW50IG1haW4odm9pZCl7CiAgICBpbnQgbixpOwogICAgaW50ICp2OwogICAgc2NhbmYoIiVkIiwmbik7CiAgICB2ID0gKGludCopbWFsbG9jKHNpemVvZihpbnQpKm4pOwogICAgaWYodj09TlVMTCl7CiAgICAgICAgcHJpbnRmKCJFUlJPUlxuIik7CiAgICAgICAgcmV0dXJuIC0xOwogICAgfQogICAgZm9yKGk9MDtpPG47aSsrKXsKICAgICAgICBzY2FuZigiJWQiLCZ2W2ldKTsKICAgIH0KICAgIEJ1Y2tldFNvcnQodixuKTsKICAgIHByaW50QSh2LG4pOwogICAgZnJlZSh2KTsKICAgIHJldHVybiAwOwp9Cgo=