Language: C++

#include<bits/stdc++.h>
typedef p pair<int,int>
#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: 'p' does not name a type
    2 | typedef p pair<int,int>
      |         ^
a.cc:6:1: error: 'p' does not name a type
    6 | p a[300010],c;
      | ^
a.cc:7:1: error: 'priority_queue' does not name a type
    7 | priority_queue<p,vector<p>,greater<p> >Q;
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:22: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    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;}
      |                      ^~~
      |                      std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
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:69: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    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;}
      |                                                                     ^~~~
      |                                                                     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
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:148: error: 'Q' 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:255: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    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;}
      |                                                                                                                                                                                                                                                               ^~~~
      |                                                                                                                                                                                                                                                               std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:264: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    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;}
      |                                                                                                                                                                                                                                                                        ^~~~
      |                                                                                                                                                                                                                                                                        std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~