Language: C++

#include<iostream>
#include<algorithm>
#include<queue>
typedef pair<int,int> 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:4:9: error: 'pair' does not name a type
    4 | typedef pair<int,int> p;
      |         ^~~~
a.cc:8:1: error: 'p' does not name a type
    8 | p a[300010],c;
      | ^
a.cc:9:16: error: 'p' was not declared in this scope
    9 | priority_queue<p,vector<p>,greater<p> >q;
      |                ^
a.cc:9:25: error: 'p' was not declared in this scope
    9 | priority_queue<p,vector<p>,greater<p> >q;
      |                         ^
a.cc:9:26: error: template argument 1 is invalid
    9 | priority_queue<p,vector<p>,greater<p> >q;
      |                          ^
a.cc:9:26: error: template argument 2 is invalid
a.cc:9:36: error: 'p' was not declared in this scope
    9 | priority_queue<p,vector<p>,greater<p> >q;
      |                                    ^
a.cc:9:37: error: template argument 1 is invalid
    9 | priority_queue<p,vector<p>,greater<p> >q;
      |                                     ^
a.cc:9:39: error: template argument 1 is invalid
    9 | priority_queue<p,vector<p>,greater<p> >q;
      |                                       ^
a.cc:9:39: error: template argument 2 is invalid
a.cc:9:39: error: template argument 3 is invalid
a.cc: In function 'int main()':
a.cc:10:61: error: 'a' was not declared in this scope
   10 | 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:10:82: error: 'a' was not declared in this scope
   10 | 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:10:130: error: 'c' was not declared in this scope
   10 | 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:10:154: error: request for member 'push' in 'q', which is of non-class type 'int'
   10 | 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:10:171: error: request for member 'empty' in 'q', which is of non-class type 'int'
   10 | 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:10:188: error: request for member 'size' in 'q', which is of non-class type 'int'
   10 | 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:10:197: error: request for member 'top' in 'q', which is of non-class type 'int'
   10 | 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:10:216: error: request for member 'top' in 'q', which is of non-class type 'int'
   10 | 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:10:226: error: request for member 'pop' in 'q', which is of non-class type 'int'
   10 | 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:10:240: error: request for member 'size' in 'q', which is of non-class type 'int'
   10 | 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:10:251: error: request for member 'size' in 'q', which is of non-class type 'int'
   10 | 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;}
      |                                                                                                                                                                                                                                                           ^~~~