foo.cpp:7:7: error: 'maxn' does not name a type
const maxn=10000+5;
^
foo.cpp:8:7: error: 'maxn' was not declared in this scope
int a[maxn];
^
foo.cpp: In function 'void heap(int, int)':
foo.cpp:15:11: error: 'a' was not declared in this scope
if(i<n&&a[i]>a[i+1])i++;
^
foo.cpp:16:6: error: 'a' was not declared in this scope
if(a[i]<a[i/2])swap(a[i],a[i/2]);
^
foo.cpp: In function 'int main()':
foo.cpp:25:28: error: 'a' was not declared in this scope
for(int i=1;i<=n;i++)cin>>a[i];
^
foo.cpp:27:10: error: 'a' was not declared in this scope
int ans=a[1];
^