r.it.igec
BAN USER- 0of 0 votes
Answers#include <stdio.h>
- r.it.igec in India
#include <stdlib.h>
#include <time.h>
#include <stdint.h>
#define _uint64_t
unsigned long long int i,R,L;
int f1(unsigned long long int num);
//unsigned long long int a[999999999];
unsigned long long int *a=NULL;
unsigned long long int j,r;
unsigned long long int main()
{
//printf("enter Minimum value for Delicious Dishes\n");
scanf("%llu",&L);
//printf("enter Maximum value for Delicious Dishes\n");
scanf("%llu",&R);
j=L+1;
a=(unsigned long long int *)malloc(sizeof(R-L));
//int f1(int a[]);
for(i=0;i<(R-L);i++)
{
//j=L+1;
*(a+i)=j;
j=j+1;
}
//printf("Now Delicious Dishes List is Ready.....:\n\n { ");
for(i=0;i<R-L;i++)
{
r=f1(*(a+i));
if(r==1)
{
//printf("not Delicious Dishes List:\n");
//printf("%d",a[i]);
}
else{
printf(" %llu ,",*(a+i));
}
}
//printf(" };\n\n");
//int random;
//srand(time(NULL));
//random=a[rand()%(sizeof(a) /sizeof(a[0]))];
printf("%llu\n ",*(a+4));
return 0;
}
int f1(unsigned long long int k)
{
unsigned long long int rep=0;
while(k>0)
{
if(rep & 1 <<(k%10))
return 1;
rep|= 1 << (k % 10);
k = k / 10;
}
return 0;
}
its give result correct but in large input value ex L=123456,R=123456789 its give core dump i have already using standard gcc compiler and take unsigned long long int but still giving runtime error core dump can anyone hel me for resolve this bugs| Report Duplicate | Flag | PURGE
Directi Algorithm