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;
int main(){priority_queue<p,vector<p>,greater<p> >q;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: In function 'int main()':
a.cc:10:27: error: 'p' was not declared in this scope
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:37: error: template argument 2 is invalid
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:50: error: template argument 1 is invalid
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:50: error: template argument 2 is invalid
a.cc:10:50: error: template argument 3 is invalid
a.cc:10:102: error: 'a' was not declared in this scope
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:123: error: 'a' was not declared in this scope
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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: 'c' was not declared in this scope
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:195: error: request for member 'push' in 'q', which is of non-class type 'int'
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:212: error: request for member 'empty' in 'q', which is of non-class type 'int'
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:229: error: request for member 'size' in 'q', which is of non-class type 'int'
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:238: error: request for member 'top' in 'q', which is of non-class type 'int'
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:257: error: request for member 'top' in 'q', which is of non-class type 'int'
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:267: error: request for member 'pop' in 'q', which is of non-class type 'int'
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:281: error: request for member 'size' in 'q', which is of non-class type 'int'
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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:292: error: request for member 'size' in 'q', which is of non-class type 'int'
   10 | int main(){priority_queue<p,vector<p>,greater<p> >q;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;}
      |                                                                                                                                                                                                                                                                                                    ^~~~