foo.cpp:1:1: error: 'include' does not name a type
include <iostream>
^~~~~~~
foo.cpp: In function 'int main()':
foo.cpp:24:1: error: 'cin' was not declared in this scope
cin>>n;
^~~
foo.cpp:27:11: error: 'sort' was not declared in this scope
sort(p,p+n);
^
foo.cpp:29:32: error: 'abs' was not declared in this scope
count1+=abs(p[i].y-p[(n+1)/2].y);
^
foo.cpp:31:28: error: 'abs' was not declared in this scope
count2+=abs(p[i].y-p[n/2].y);
^
foo.cpp:33:1: error: 'cout' was not declared in this scope
cout<<count2;
^~~~
foo.cpp:35:1: error: 'cout' was not declared in this scope
cout<<count1;
^~~~