Language: C++

#include<bits/stdc++.h>
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;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:2:9: error: 'pair' does not name a type
    2 | typedef pair<int,int> p;
      |         ^~~~
a.cc:6:1: error: 'p' does not name a type
    6 | p a[300010],c;
      | ^
a.cc:7:16: error: 'p' was not declared in this scope
    7 | priority_queue<p,vector<p>,greater<p> >Q;
      |                ^
a.cc:7:25: error: 'p' was not declared in this scope
    7 | priority_queue<p,vector<p>,greater<p> >Q;
      |                         ^
a.cc:7:26: error: template argument 1 is invalid
    7 | priority_queue<p,vector<p>,greater<p> >Q;
      |                          ^
a.cc:7:26: error: template argument 2 is invalid
a.cc:7:36: error: 'p' was not declared in this scope
    7 | priority_queue<p,vector<p>,greater<p> >Q;
      |                                    ^
a.cc:7:37: error: template argument 1 is invalid
    7 | priority_queue<p,vector<p>,greater<p> >Q;
      |                                     ^
a.cc:7:39: error: template argument 1 is invalid
    7 | priority_queue<p,vector<p>,greater<p> >Q;
      |                                       ^
a.cc:7:39: error: template argument 2 is invalid
a.cc:7:39: error: template argument 3 is invalid
a.cc: In function 'int main()':
a.cc:8:54: error: 'a' was not declared in this scope
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:74: error: 'a' was not declared in this scope
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:126: error: 'c' was not declared in this scope
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:150: error: request for member 'push' in 'Q', which is of non-class type 'int'
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:167: error: request for member 'empty' in 'Q', which is of non-class type 'int'
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:184: error: request for member 'size' in 'Q', which is of non-class type 'int'
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:193: error: request for member 'top' in 'Q', which is of non-class type 'int'
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:212: error: request for member 'top' in 'Q', which is of non-class type 'int'
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:222: error: request for member 'pop' in 'Q', which is of non-class type 'int'
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:236: error: request for member 'size' in 'Q', which is of non-class type 'int'
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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:8:247: error: request for member 'size' in 'Q', which is of non-class type 'int'
    8 | int main(){int n,r=0;cin>>n;for(int i=0;i<n;i++)cin>>a[i].x>>a[i].y;sort(a,a+n);long long s=0;for(int 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;}
      |                                                                                                                                                                                                                                                       ^~~~