Language: C++

#include<iostream>
#include<algorithm>
#include<queue>
typedef long long int ll;
typedef pair<ll,ll> p;
#define x first
#define y second
using namespace std;
p a[300010],c;
priority_queue<p,vector<p>,greater<p> >q;
int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}

Compiler output:
a.cc:5:9: error: 'pair' does not name a type
    5 | typedef pair<ll,ll> p;
      |         ^~~~
a.cc:9:1: error: 'p' does not name a type
    9 | p a[300010],c;
      | ^
a.cc:10:16: error: 'p' was not declared in this scope
   10 | priority_queue<p,vector<p>,greater<p> >q;
      |                ^
a.cc:10:25: error: 'p' was not declared in this scope
   10 | priority_queue<p,vector<p>,greater<p> >q;
      |                         ^
a.cc:10:26: error: template argument 1 is invalid
   10 | priority_queue<p,vector<p>,greater<p> >q;
      |                          ^
a.cc:10:26: error: template argument 2 is invalid
a.cc:10:36: error: 'p' was not declared in this scope
   10 | priority_queue<p,vector<p>,greater<p> >q;
      |                                    ^
a.cc:10:37: error: template argument 1 is invalid
   10 | priority_queue<p,vector<p>,greater<p> >q;
      |                                     ^
a.cc:10:39: error: template argument 1 is invalid
   10 | priority_queue<p,vector<p>,greater<p> >q;
      |                                       ^
a.cc:10:39: error: template argument 2 is invalid
a.cc:10:39: error: template argument 3 is invalid
a.cc: In function 'int main()':
a.cc:11:61: error: 'a' was not declared in this scope
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                             ^
a.cc:11:82: error: 'a' was not declared in this scope
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                  ^
a.cc:11:130: error: 'c' was not declared in this scope
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                  ^
a.cc:11:154: error: request for member 'push' in 'q', which is of non-class type 'int'
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                                          ^~~~
a.cc:11:171: error: request for member 'empty' in 'q', which is of non-class type 'int'
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                                                           ^~~~~
a.cc:11:188: error: request for member 'size' in 'q', which is of non-class type 'int'
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                                                                            ^~~~
a.cc:11:197: error: request for member 'top' in 'q', which is of non-class type 'int'
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                                                                                     ^~~
a.cc:11:216: error: request for member 'top' in 'q', which is of non-class type 'int'
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                                                                                                        ^~~
a.cc:11:226: error: request for member 'pop' in 'q', which is of non-class type 'int'
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                                                                                                                  ^~~
a.cc:11:240: error: request for member 'size' in 'q', which is of non-class type 'int'
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                                                                                                                                ^~~~
a.cc:11:251: error: request for member 'size' in 'q', which is of non-class type 'int'
   11 | int main(){int n,r=0,i;cin>>n;for(i=0;i<n;i++)scanf("%d%d",&a[i].x,&a[i].y);sort(a,a+n);long long s=0;for(i=0;i<n;i++){s+=a[i].x,c.x=a[i].y,c.y=a[i].x;q.push(c);while(!q.empty()){if(s<=q.size()*q.top().x)break;s-=q.top().y,q.pop();}if(r<q.size())r=q.size();}cout<<r<<endl;return 0;}
      |                                                                                                                                                                                                                                                           ^~~~