foo.c: In function 'time_taken':
foo.c:39:9: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
time+=abs(arr[i]-mid);
^~~
foo.c: In function 'main':
foo.c:49:9: error: 'new' undeclared (first use in this function)
int *a=new int[n];
^~~
foo.c:49:9: note: each undeclared identifier is reported only once for each function it appears in
foo.c:49:13: error: expected ',' or ';' before 'int'
int *a=new int[n];
^~~
foo.c:50:13: error: expected ',' or ';' before 'int'
int *b=new int[n];
^~~
foo.c:48:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&m);
^~~~~~~~~~~~~~~~~~~
foo.c:51:20: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
for(i = 0;i<n;i++)scanf("%d",&a[i]);
^~~~~~~~~~~~~~~~~
foo.c:54:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&l,&r);
^~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务