Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int Unos(long a[], long broj)
{
int h, broj1 = broj;
int br=0;
int test = 0;
long N=50000;
do
{
h = broj1;
if (a[h] < 1)
{
a[h] = broj;
test = 1;
break;
}
else
{
broj1++;
br++;
}
} while (broj1 < (broj + N) && test!=0);
return (br);
}
int main()
{
long niz[100000],i,a[50000];
int br=0;
for(i=0;i<100000;i++)
niz[i]=i;
for(i=0;i<50000;i++)
a[i]=0;
for(i=0;i<100000;i++)
br=Unos(a,niz[i]);
br=br+br;
printf("br =%d",br);
for(i=0;i<50000;i++)
printf("%d",a[i]);
printf("%d",a[0]);
printf("\n\nbr =%d",br);
return 0;
}
this is what i wrote but don't know how to write hash :S