// 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];
//ここから下を書く
for(i=0; i<MAX; i++){
b[i]=0;
}
t=0;
for(i=0; i<n; i++){
b[a[i]]=1;
}
for(i=0; i<n; i++){
a[t++]=a[i];
}
for(i=0; i<MAX; i++){
for(int j=0; j<n; j++){
if(b[i]==1)
swap(&a[t],&a[j]);
}
}
}
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;
}
Ly8gQnVja2V0U29ydAojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPgoKdm9pZCBwcmludEEoaW50IGFbXSwgaW50IG4pewogICAgaW50IGk7CiAgICBmb3IoaT0wO2k8bjtpKyspewogICAgICAgIHByaW50ZigiJWQgIixhW2ldKTsKICAgIH0KICAgIHByaW50ZigiXG4iKTsKfQoKdm9pZCBzd2FwKGludCogYSwgaW50KiBiKXsKICAgIGludCAgdG1wOwogICAgdG1wID0gKmE7CiAgICAqYSA9ICpiOwogICAgKmIgPSB0bXA7Cn0KCiNkZWZpbmUgTUFYIDEwMDAwMDAKdm9pZCBCdWNrZXRTb3J0KGludCBhW10sIGludCBuKXsKICAgIGludCBpLHQ7CiAgICBpbnQgYltNQVhdOwogICAgLy/jgZPjgZPjgYvjgonkuIvjgpLmm7jjgY8KICAgIAoJZm9yKGk9MDsgaTxNQVg7IGkrKyl7CgkJYltpXT0wOwoJfQoJCgl0PTA7CgkKICAgIGZvcihpPTA7IGk8bjsgaSsrKXsKICAgIAkgYlthW2ldXT0xOwogICAgfQogICAgCiAgICBmb3IoaT0wOyBpPG47IGkrKyl7CiAgICAJYVt0KytdPWFbaV07CiAgICB9CiAgICAKICAgICBmb3IoaT0wOyBpPE1BWDsgaSsrKXsKICAgICAJZm9yKGludCBqPTA7IGo8bjsgaisrKXsKICAgIAlpZihiW2ldPT0xKQoJCXN3YXAoJmFbdF0sJmFbal0pOwogICAgIAl9CiAgICAgfQp9CgppbnQgbWFpbih2b2lkKXsKICAgIGludCBuLGk7CiAgICBpbnQgKnY7CiAgICBzY2FuZigiJWQiLCZuKTsKICAgIHYgPSAoaW50KiltYWxsb2Moc2l6ZW9mKGludCkqbik7CiAgICBpZih2PT1OVUxMKXsKICAgICAgICBwcmludGYoIkVSUk9SXG4iKTsKICAgICAgICByZXR1cm4gLTE7CiAgICB9CiAgICBmb3IoaT0wO2k8bjtpKyspewogICAgICAgIHNjYW5mKCIlZCIsJnZbaV0pOwogICAgfQogICAgQnVja2V0U29ydCh2LG4pOwogICAgcHJpbnRBKHYsbik7CiAgICBmcmVlKHYpOwogICAgcmV0dXJuIDA7Cn0K