criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<pair<ll, ll>>a(N);
  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    a[i] = make_pair(y, x);
  }
  sort(a.begin(), a.end());
  int T = 0;
  for (int i = 0; i < N; i++) {
    T += a[i].second;
  }
  if (T <= a[N - 1].first) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'll' was not declared in this scope
    7 |   vector<pair<ll, ll>>a(N);
      |               ^~
a.cc:7:19: error: template argument 1 is invalid
    7 |   vector<pair<ll, ll>>a(N);
      |                   ^~
a.cc:7:21: error: template argument 1 is invalid
    7 |   vector<pair<ll, ll>>a(N);
      |                     ^~
a.cc:7:21: error: template argument 2 is invalid
a.cc:11:6: error: invalid types 'int[int]' for array subscript
   11 |     a[i] = make_pair(y, x);
      |      ^
a.cc:13:10: error: request for member 'begin' in 'a', which is of non-class type 'int'
   13 |   sort(a.begin(), a.end());
      |          ^~~~~
a.cc:13:21: error: request for member 'end' in 'a', which is of non-class type 'int'
   13 |   sort(a.begin(), a.end());
      |                     ^~~
a.cc:16:11: error: invalid types 'int[int]' for array subscript
   16 |     T += a[i].second;
      |           ^
a.cc:18:13: error: invalid types 'int[int]' for array subscript
   18 |   if (T <= a[N - 1].first) cout << "Yes" << endl;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin >> n;
  vector<pair<int,int>> p(n);
  for(int i=0;i<n;i++){
    cin >> p[i].second >> p[i].first;
  }
  sort(p.begin(),p.end());
  int t=0;
  string ans = "Yes";
  for(int i=0;i<N;i++){
    t =+p[i].second;
    if(t > p[i].first){
      ans = "No";
      break;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'N' was not declared in this scope
   14 |   for(int i=0;i<N;i++){
      |                 ^
Language: C++

#include "bits/stdc++.h"

using namespace std;

using pii = pair<int, int>;

int main() {
    int n; cin >> n;
    vector<pii> jobs;
    for (int i = 0; i < n; ++i) {
        int a, b; cin >> a >> b;
        jobs.emplace_back(b, a);
    }
    
    sort(jobs.begin(), jobs.end(), [](const pii& l, const pii& r) {
        if (l.first == r.first) return l.second > r.second;
        return l.first > r.first;
    });
    
    int next_start = jobs.front().first;
    for (pii& x : jobs) {
        if (next_start > x.first) {
            next_start = x.first;
        }
        next_start -= x.second;
        if (next_start < 0) {
            cout << "No" << endl;
            return 0;
        }
        
        // cout << x.first << ", " << x.second << endl;
    }
    cout << "Yes" << endl;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: expected '}' at end of input
   34 |     return 0;
      |              ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

vector<size_t> sort_indexes(const vector<int> &v) {

  // initialize original index locations
  vector<size_t> idx(v.size());
  iota(idx.begin(), idx.end(), 0);

  // sort indexes based on comparing values in v
  sort(idx.begin(), idx.end(),
       [&v](size_t i1, size_t i2) {return v[i1] < v[i2];});

  return idx;
}

int main(int argc, char const *argv[]){
    int n;
    cin >> n;
    vector<int> a, b;
    int work = 0;
    for(int i=0;i<n;i++){
        int _a, _b;
        cin >> _a >> _b;
        a.push_back(_a);
        b.push_back(_b);
    }
    vector<size_t> idx(n);
    idx = sort_indexes(b);
    for(int i=0;i<n;i++){
        work += a[idx[i]];
        if(work>b[idx[i]]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'std::vector<long unsigned int> sort_indexes(const std::vector<int>&)':
a.cc:11:3: error: 'iota' was not declared in this scope
   11 |   iota(idx.begin(), idx.end(), 0);
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
vector<pair<int,int>> tasks;
 
int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  
  int N; 
  cin >> N;
  
  for(i=0,i<n,i++){
    int a,b;
    cin >> a >> b;
    tasks.emplace_back(b,a);
  }
  
  sort(tasks.begin(),tasks.end());
  int sum =0;
  bool kekka =true;
  
  for(auto v:tasks){
    sum += v.second;
    if(sum>v.first){
      kekka =false;
      break;
    } 
  }
  
  cout << kekka? "Yes" : "No" << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=0,i<n,i++){
      |       ^
a.cc:14:13: error: 'n' was not declared in this scope
   14 |   for(i=0,i<n,i++){
      |             ^
a.cc:20:7: error: could not convert 'std::sort<__gnu_cxx::__normal_iterator<pair<int, int>*, vector<pair<int, int> > > >(tasks.std::vector<std::pair<int, int> >::begin(), tasks.std::vector<std::pair<int, int> >::end())' from 'void' to 'bool'
   20 |   sort(tasks.begin(),tasks.end());
      |   ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |       |
      |       void
a.cc:21:3: error: expected primary-expression before 'int'
   21 |   int sum =0;
      |   ^~~
a.cc:20:35: error: expected ')' before 'int'
   20 |   sort(tasks.begin(),tasks.end());
      |                                   ^
      |                                   )
   21 |   int sum =0;
      |   ~~~                              
a.cc:14:6: note: to match this '('
   14 |   for(i=0,i<n,i++){
      |      ^
a.cc:25:5: error: 'sum' was not declared in this scope
   25 |     sum += v.second;
      |     ^~~
a.cc:32:31: error: invalid operands of types 'const char [3]' and 'char' to binary 'operator<<'
   32 |   cout << kekka? "Yes" : "No" << '\n';
      |                          ~~~~ ^~ ~~~~
      |                          |       |
      |                          |       char
      |                          const char [3]
Language: C++

#include<iostream>
int main()
{
  unsigned short int N,i,j;
  unsigned long int *A;
  unsigned long int *B;
  unsigned long int buffA,buffB,sumA=0;
  bool flag=true;
  std::cin >>N;
  A= new unsigned long int A[N];
  B= new unsigned long int B[N];
  for(i=0;i<N;i++){//入力
    std::cin >>A[i] >>B[i];
    for(j=0;j<i;j++){//上から入力済みデータを参照
      if(B[i]<B[j]){//直近の入力データよりＢが大きいデータを検索
        //上でヒットしたデータのすぐ上に挿入
        buffA=A[j];
        buffB=B[j];
        A[j]=A[i];
        B[j]=B[i];
        A[i]=buffA;
        B[i]=buffB;
      }
    }
  }
  for(i=0;i<N;i++){
    sumA=sumA+A[i];
    if(sumA<B[i])
    {
      flag=false;
      break;
    }
  }
  if(flag) std::cout<<"Yes"<<std::endl;
  else     std::cout<<"No"<<std::endl;
  delete[] A;
  delete[] B;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: expected ';' before 'A'
   10 |   A= new unsigned long int A[N];
      |                           ^~
      |                           ;
a.cc:11:27: error: expected ';' before 'B'
   11 |   B= new unsigned long int B[N];
      |                           ^~
      |                           ;
Language: C++

#include<>
int main()
{
  unsigned short int N,i,j;
  unsigned long int *A;
  unsigned long int *B;
  unsigned long int buffA,buffB,sumA=0;
  bool flag=true;
  std::cin >>N;
  A= new unsigned long int A[N];
  B= new unsigned long int B[N];
  for(i=0;i<N;i++){//入力
    std::cin >>A[i] >>B[i];
    for(j=0;j<i;j++){//上から入力済みデータを参照
      if(B[i]<B[j]){//直近の入力データよりＢが大きいデータを検索
        //上でヒットしたデータのすぐ上に挿入
        buffA=A[j];
        buffB=B[j];
        A[j]=A[i];
        B[j]=B[i];
        A[i]=buffA;
        B[i]=buffB;
      }
    }
  }
  for(i=0;i<N;i++){
    sumA=sumA+A[i];
    if(sumA<B[i])
    {
      flag=false;
      break;
    }
  }
  if(flag) std::cout<<"Yes"<<std::endl;
  else     std::cout<<"No"<<std::endl;
  delete[] A;
  delete[] B;
  return 0;
}
#include<iostrem>
int main()
{
  unsigned short int N,i,j;
  unsigned long int *A;
  unsigned long int *B;
  unsigned long int buffA,buffB,sumA=0;
  bool flag=true;
  std::cin >>N;
  A= new unsigned long int A[N];
  B= new unsigned long int B[N];
  for(i=0;i<N;i++){//入力
    std::cin >>A[i] >>B[i];
    for(j=0;j<i;j++){//上から入力済みデータを参照
      if(B[i]<B[j]){//直近の入力データよりＢが大きいデータを検索
        //上でヒットしたデータのすぐ上に挿入
        buffA=A[j];
        buffB=B[j];
        A[j]=A[i];
        B[j]=B[i];
        A[i]=buffA;
        B[i]=buffB;
      }
    }
  }
  for(i=0;i<N;i++){
    sumA=sumA+A[i];
    if(sumA<B[i])
    {
      flag=false;
      break;
    }
  }
  if(flag) std::cout<<"Yes"<<std::endl;
  else     std::cout<<"No"<<std::endl;
  delete[] A;
  delete[] B;
  return 0;
}

Compiler output:
a.cc:1:9: error: empty filename in #include
    1 | #include<>
      |         ^~
a.cc:40:9: fatal error: iostrem: No such file or directory
   40 | #include<iostrem>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
int main()
{
  unsigned short int N,i,j;
  unsigned long int *A;
  unsigned long int *B;
  unsigned long int buffA,buffB,sumA=0;
  bool flag=true;
  std::cin >>N;
  A= new unsigned long int A[N];
  B= new unsigned long int B[N];
  for(i=0;i<N;i++){//入力
    std::cin >>A[i] >>B[i];
    for(j=0;j<i;j++){//上から入力済みデータを参照
      if(B[i]<B[j]){//直近の入力データよりＢが大きいデータを検索
        //上でヒットしたデータのすぐ上に挿入
        buffA=A[j];
        buffB=B[j];
        A[j]=A[i];
        B[j]=B[i];
        A[i]=buffA;
        B[i]=buffB;
      }
    }
  }
  for(i=0;i<N;i++){
    sumA=sumA+A[i];
    if(sumA<B[i])
    {
      flag=false;
      break;
    }
  }
  if(flag) std::cout<<"Yes"<<std::endl;
  else     std::cout<<"No"<<std::endl;
  delete[] A;
  delete[] B;
  return 0;
}
#include<iostrem>
int main()
{
  unsigned short int N,i,j;
  unsigned long int *A;
  unsigned long int *B;
  unsigned long int buffA,buffB,sumA=0;
  bool flag=true;
  std::cin >>N;
  A= new unsigned long int A[N];
  B= new unsigned long int B[N];
  for(i=0;i<N;i++){//入力
    std::cin >>A[i] >>B[i];
    for(j=0;j<i;j++){//上から入力済みデータを参照
      if(B[i]<B[j]){//直近の入力データよりＢが大きいデータを検索
        //上でヒットしたデータのすぐ上に挿入
        buffA=A[j];
        buffB=B[j];
        A[j]=A[i];
        B[j]=B[i];
        A[i]=buffA;
        B[i]=buffB;
      }
    }
  }
  for(i=0;i<N;i++){
    sumA=sumA+A[i];
    if(sumA<B[i])
    {
      flag=false;
      break;
    }
  }
  if(flag) std::cout<<"Yes"<<std::endl;
  else     std::cout<<"No"<<std::endl;
  delete[] A;
  delete[] B;
  return 0;
}

Compiler output:
a.cc:40:9: fatal error: iostrem: No such file or directory
   40 | #include<iostrem>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
int main()
{
  unsigned short int N,i,j;
  unsigned long int *A;
  unsigned long int *B;
  unsigned long int buffA,buffB,sumA=0;
  bool flag=true;
  std::cin >>N;
  A= new unsigned long int A[N];
  B= new unsigned long int B[N];
  for(i=0;i<N;i++){//入力
    std::cin >>A[i] >>B[i];
    for(j=0;j<i;j++){//上から入力済みデータを参照
      if(B[i]<B[j]){//直近の入力データよりＢが大きいデータを検索
        //上でヒットしたデータのすぐ上に挿入
        buffA=A[j];
        buffB=B[j];
        A[j]=A[i];
        B[j]=B[i];
        A[i]=buffA;
        B[i]=buffB;
      }
    }
  }
  for(i=0;i<N;i++){
    sumA=sumA+A[i];
    if(sumA<B[i])
    {
      flag=false;
      break;
    }
  }
  if(flag) std::cout<<"Yes"<<std::endl;
  else     std::cout<<"No"<<std::endl;
  delete[] A;
  delete[] B;
  return 0;
}
#include<iostrem>
int main()
{
  unsigned short int N,i,j;
  unsigned long int *A;
  unsigned long int *B;
  unsigned long int buffA,buffB,sumA=0;
  bool flag=true;
  std::cin >>N;
  A= new unsigned long int A[N];
  B= new unsigned long int B[N];
  for(i=0;i<N;i++){//入力
    std::cin >>A[i] >>B[i];
    for(j=0;j<i;j++){//上から入力済みデータを参照
      if(B[i]<B[j]){//直近の入力データよりＢが大きいデータを検索
        //上でヒットしたデータのすぐ上に挿入
        buffA=A[j];
        buffB=B[j];
        A[j]=A[i];
        B[j]=B[i];
        A[i]=buffA;
        B[i]=buffB;
      }
    }
  }
  for(i=0;i<N;i++){
    sumA=sumA+A[i];
    if(sumA<B[i])
    {
      flag=false;
      break;
    }
  }
  if(flag) std::cout<<"Yes"<<std::endl;
  else     std::cout<<"No"<<std::endl;
  delete[] A;
  delete[] B;
  return 0;
}
提出情報
提出日時	2019-06-29 12:36:52
問題

Compiler output:
a.cc:40:9: fatal error: iostrem: No such file or directory
   40 | #include<iostrem>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostrem>
int main()
{
  unsigned short int N,i,j;
  unsigned long int *A;
  unsigned long int *B;
  unsigned long int buffA,buffB,sumA=0;
  bool flag=true;
  std::cin >>N;
  A= new unsigned long int A[N];
  B= new unsigned long int B[N];
  for(i=0;i<N;i++){//入力
    std::cin >>A[i] >>B[i];
    for(j=0;j<i;j++){//上から入力済みデータを参照
      if(B[i]<B[j]){//直近の入力データよりＢが大きいデータを検索
        //上でヒットしたデータのすぐ上に挿入
        buffA=A[j];
        buffB=B[j];
        A[j]=A[i];
        B[j]=B[i];
        A[i]=buffA;
        B[i]=buffB;
      }
    }
  }
  for(i=0;i<N;i++){
    sumA=sumA+A[i];
    if(sumA<B[i])
    {
      flag=false;
      break;
    }
  }
  if(flag) std::cout<<"Yes"<<std::endl;
  else     std::cout<<"No"<<std::endl;
  delete[] A;
  delete[] B;
  return 0;
}

Compiler output:
a.cc:1:9: fatal error: iostrem: No such file or directory
    1 | #include<iostrem>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>

using namespace std;

struct job {
    int t;
    int limit;
};


int main()
{
    int N;

    vector<int> A;
    vector<int> B;
    vector<job> J;

    cin >> N;

    int ia, ib;
    for ( int i = 0; i < N; i ++ ) {
        cin >> ia >> ib;
        job j;
        j.t = ia;
        j.limit = ib;    
        J.push_back( j );
    }

#ifdef TEST
    for ( int i = 0; i < J.size(); i ++ ) {
        cout << J[i].t << " " << J[i].limit << endl;
    }
#endif

    sort( J.begin(), J.end(), 
        [](const job& lhs, const job& rhs) { return lhs.limit < rhs.limit;} );

#ifdef TEST
    for ( int i = 0; i < J.size(); i ++ ) {
        cout << J[i].t << " " << J[i].limit << endl;
    }
#endif

    int T;

    T = 0;
    for ( int i = 0; i < N; i ++ ) {
        T += J[i].t;
#ifdef TEST
        cout << "T " << T << " " << J[i].t << " " << J[i].limit << endl;
#endif
        if ( T > J[i].limit ) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   37 |     sort( J.begin(), J.end(),
      |     ^~~~
      |     short
Language: C++

#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
using ll = long long;
using P = pair<ll, ll>;
constexpr ll mod = 1000000007;
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<P> ba(n);
	for (int i = 0; i < n; i++) {
		cin >> ba[i].second >> ba[i].first;
	}
	sort(all(ba));
	ll sum = 0;
	for (int i = 0; i < n; i++) {
		sum += ba[i].second;
		if (sum > ba[i].first) {
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
}

Compiler output:
a.cc:4:11: error: 'pair' does not name a type
    4 | using P = pair<ll, ll>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:12:16: error: 'P' was not declared in this scope
   12 |         vector<P> ba(n);
      |                ^
a.cc:12:17: error: template argument 1 is invalid
   12 |         vector<P> ba(n);
      |                 ^
a.cc:12:17: error: template argument 2 is invalid
a.cc:14:26: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> ba[i].second >> ba[i].first;
      |                          ^
a.cc:14:42: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> ba[i].second >> ba[i].first;
      |                                          ^
a.cc:2:18: error: request for member 'begin' in 'ba', which is of non-class type 'int'
    2 | #define all(a) a.begin(), a.end()
      |                  ^~~~~
a.cc:16:14: note: in expansion of macro 'all'
   16 |         sort(all(ba));
      |              ^~~
a.cc:2:29: error: request for member 'end' in 'ba', which is of non-class type 'int'
    2 | #define all(a) a.begin(), a.end()
      |                             ^~~
a.cc:16:14: note: in expansion of macro 'all'
   16 |         sort(all(ba));
      |              ^~~
a.cc:19:26: error: invalid types 'int[int]' for array subscript
   19 |                 sum += ba[i].second;
      |                          ^
a.cc:20:29: error: invalid types 'int[int]' for array subscript
   20 |                 if (sum > ba[i].first) {
      |                             ^
Language: C++

#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
using ll = long long;
using p = pair<ll, ll>;
constexpr ll mod = 1000000007;
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<p> ba(n);
	for (int i = 0; i < n; i++) {
		cin >> ba[i].second >> ba[i].first;
	}
	sort(all(ba));
	ll sum = 0;
	for (int i = 0; i < n; i++) {
		sum += ba[i].second;
		if (sum > ba[i].first) {
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
}

Compiler output:
a.cc:4:11: error: 'pair' does not name a type
    4 | using p = pair<ll, ll>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:12:16: error: 'p' was not declared in this scope
   12 |         vector<p> ba(n);
      |                ^
a.cc:12:17: error: template argument 1 is invalid
   12 |         vector<p> ba(n);
      |                 ^
a.cc:12:17: error: template argument 2 is invalid
a.cc:14:26: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> ba[i].second >> ba[i].first;
      |                          ^
a.cc:14:42: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> ba[i].second >> ba[i].first;
      |                                          ^
a.cc:2:18: error: request for member 'begin' in 'ba', which is of non-class type 'int'
    2 | #define all(a) a.begin(), a.end()
      |                  ^~~~~
a.cc:16:14: note: in expansion of macro 'all'
   16 |         sort(all(ba));
      |              ^~~
a.cc:2:29: error: request for member 'end' in 'ba', which is of non-class type 'int'
    2 | #define all(a) a.begin(), a.end()
      |                             ^~~
a.cc:16:14: note: in expansion of macro 'all'
   16 |         sort(all(ba));
      |              ^~~
a.cc:19:26: error: invalid types 'int[int]' for array subscript
   19 |                 sum += ba[i].second;
      |                          ^
a.cc:20:29: error: invalid types 'int[int]' for array subscript
   20 |                 if (sum > ba[i].first) {
      |                             ^
Language: C++

#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef pair<ll, ll> p;
constexpr ll mod = 1000000007;
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<p> ba(n);
	for (int i = 0; i < n; i++) {
		cin >> ba[i].second >> ba[i].first;
	}
	sort(all(ba));
	ll sum = 0;
	for (int i = 0; i < n; i++) {
		sum += ba[i].second;
		if (sum > ba[i].first) {
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
}

Compiler output:
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<ll, ll> p;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:12:16: error: 'p' was not declared in this scope
   12 |         vector<p> ba(n);
      |                ^
a.cc:12:17: error: template argument 1 is invalid
   12 |         vector<p> ba(n);
      |                 ^
a.cc:12:17: error: template argument 2 is invalid
a.cc:14:26: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> ba[i].second >> ba[i].first;
      |                          ^
a.cc:14:42: error: invalid types 'int[int]' for array subscript
   14 |                 cin >> ba[i].second >> ba[i].first;
      |                                          ^
a.cc:2:18: error: request for member 'begin' in 'ba', which is of non-class type 'int'
    2 | #define all(a) a.begin(), a.end()
      |                  ^~~~~
a.cc:16:14: note: in expansion of macro 'all'
   16 |         sort(all(ba));
      |              ^~~
a.cc:2:29: error: request for member 'end' in 'ba', which is of non-class type 'int'
    2 | #define all(a) a.begin(), a.end()
      |                             ^~~
a.cc:16:14: note: in expansion of macro 'all'
   16 |         sort(all(ba));
      |              ^~~
a.cc:19:26: error: invalid types 'int[int]' for array subscript
   19 |                 sum += ba[i].second;
      |                          ^
a.cc:20:29: error: invalid types 'int[int]' for array subscript
   20 |                 if (sum > ba[i].first) {
      |                             ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int n;
vector<pair<int, int> > tasks;

int main(void){
  	cin >> n;
	for (int i = 0; i < n; i++) { int a, b;
		cin >> a >> b;
		tasks.emplace_back(b, a); // 〆切 (, 所要時間)
	}
	sort(tasks.begin(), tasks.end());
	int sum = 0;
	bool isyes = true;
	for (auto v : tasks) {
		sum += v.second;
		if (sum > v.first) {
			isyes = false;
			break;
        }
    }
	cout << (isyes ? "Yes" : "No") << endl; 27
	return 0;
}


Compiler output:
a.cc:11:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
   11 | vector<pair<int, int> > tasks;
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:3013:12: note: 'std::pair' declared here
 3013 |     struct pair;
      |            ^~~~
a.cc:11:21: error: template argument 1 is invalid
   11 | vector<pair<int, int> > tasks;
      |                     ^
a.cc:11:21: error: template argument 2 is invalid
a.cc:11:23: error: expected unqualified-id before '>' token
   11 | vector<pair<int, int> > tasks;
      |                       ^
a.cc: In function 'int main()':
a.cc:17:17: error: 'tasks' was not declared in this scope
   17 |                 tasks.emplace_back(b, a); // 〆切 (, 所要時間)
      |                 ^~~~~
a.cc:19:14: error: 'tasks' was not declared in this scope
   19 |         sort(tasks.begin(), tasks.end());
      |              ^~~~~
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |         sort(tasks.begin(), tasks.end());
      |         ^~~~
      |         short
a.cc:29:51: error: expected ';' before 'return'
   29 |         cout << (isyes ? "Yes" : "No") << endl; 27
      |                                                   ^
      |                                                   ;
   30 |         return 0;
      |         ~~~~~~
Language: C++

#include<iostream>
#include<string>
using std::cin;
using std::cout;
using std::endl;
using std::string;

int n;
vector<pair<int, int> > tasks;

int main(void){
  	cin >> n;
	for (int i = 0; i < n; i++) { int a, b;
		cin >> a >> b;
		tasks.emplace_back(b, a); // 〆切 (, 所要時間)
	}
	sort(tasks.begin(), tasks.end());
	int sum = 0;
	bool isyes = true;
	for (auto v : tasks) {
		sum += v.second;
		if (sum > v.first) {
			isyes = false;
			break;
        }
    }
	cout << (isyes ? "Yes" : "No") << endl; 27
	return 0;
}


Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<pair<int, int> > tasks;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:15:17: error: 'tasks' was not declared in this scope
   15 |                 tasks.emplace_back(b, a); // 〆切 (, 所要時間)
      |                 ^~~~~
a.cc:17:14: error: 'tasks' was not declared in this scope
   17 |         sort(tasks.begin(), tasks.end());
      |              ^~~~~
a.cc:17:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |         sort(tasks.begin(), tasks.end());
      |         ^~~~
      |         short
a.cc:27:51: error: expected ';' before 'return'
   27 |         cout << (isyes ? "Yes" : "No") << endl; 27
      |                                                   ^
      |                                                   ;
   28 |         return 0;
      |         ~~~~~~
Language: C

#include<stdio.h>
#include<bool.h>

int main(){
  int i, j, temp, sum_a = 0, sum_b = 0;
  bool frag = true;
  
  int n;
  scanf("%d", &n);
  
  int a[n], b[n], sorted_a[n], sorted_b[n];
  for(i=0; i<n; i++){
    scanf("%d %d", &a[i], &b[i]);  
  }
  
  for(i=0; i<n; i++){
    for(j=n-1; j>i; j--){
      if(b[j] < b[j-1]){
        temp = b[j];
        b[j] = b[j-1];
        b[j-1] = temp;
        
        temp = a[j];
        a[j] = a[j-1];
        a[j-1] = temp;
      }
    }
  }
  
  for(i=0; i<n; i++){
    sum_a += a[i];
    sum_b += b[i];
    
    if(sum_a > sum_b){
      frag = false;
      break;
    }
  }
  
  if(frag){
    printf("Yes");
  }else{
    printf("No");
  }
  
  return 0;
  
}

Compiler output:
main.c:2:9: fatal error: bool.h: No such file or directory
    2 | #include<bool.h>
      |         ^~~~~~~~
compilation terminated.
Language: C++

import java.util.*;
public class Main {

    public static void main(String[] args)
    {
        int count=0;
        boolean sw=false;
        int max=Integer.MIN_VALUE;
        int min=Integer.MAX_VALUE;
        double dMax=Double.MIN_VALUE;
        double dMin=Double.MAX_VALUE;
        //int answer=0;
        String answer="Yes";
        //StringBuilder answer=new StringBuilder();

        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        ArrayList<Cost> costs=new ArrayList<>();

        for (int i=0;i<N;++i)
        {
            Cost p=new Cost(sc.nextInt(),sc.nextInt());
            costs.add(p);
        }

        costs.sort((p,q)->p.b-q.b);

        int time=0;
        for (Cost i:costs)
        {
            time+=i.a;
            if (time>i.b)
            {
                answer="No";
                break;
            }
        }

        //output
        //BigDecimal bd=new BigDecimal(answer);
        //System.out.println(bd.setScale(12,BigDecimal.ROUND_DOWN));
        //System.out.println(String.format("%.0f",answer));
        System.out.println(answer);
    }
}

class Cost
{
    int a;
    int b;

    public Cost(int x,int y)
    {
        a=x;
        b=y;
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
a.cc:52:11: error: expected ':' before 'Cost'
   52 |     public Cost(int x,int y)
      |           ^~~~~
      |           :
a.cc:57:2: error: expected ';' after class definition
   57 | }
      |  ^
      |  ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
using MY=pair<int, int>;

int main(){
  int N; cin >> N;
  vector<MY> gardman(N);
  for (int i=0;i<N;i++){
    cin >> gardmen.at(i).second >> gardman.at(i).first;
  }
  int t=0;
  for (int i=0;i<N;i++){
    t+=gardman.at(i).first;
    if (t>gardman.at(i).second){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'gardmen' was not declared in this scope; did you mean 'gardman'?
    9 |     cin >> gardmen.at(i).second >> gardman.at(i).first;
      |            ^~~~~~~
      |            gardman
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector <pair<int,int>>w(n);
  for (int i=0; i<n; i++){
    int a,b;
    cin >> a >> b;
    w[i] = make_pair(b,a);
  }
  w.sort(w.begin(),w.end());
  long long int nt = 0;
  for(int i=0; i<n; i++){
    nt += w[i].second;
    if (nt > w[i].first){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'class std::vector<std::pair<int, int> >' has no member named 'sort'
   12 |   w.sort(w.begin(),w.end());
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector <pair<int,int>>w(n);
  for (int i=0; i<n; i++){
    int a,b;
    cin >> a >> b;
    w[i] = make_pair(b,a);
  }
  w.sort(w.begin(),w.end());
  nt = 0;
  for(int i=0; i<n; i++){
    nt += w[i].second;
    if (nt > w[i].first){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'class std::vector<std::pair<int, int> >' has no member named 'sort'
   12 |   w.sort(w.begin(),w.end());
      |     ^~~~
a.cc:13:3: error: 'nt' was not declared in this scope; did you mean 'n'?
   13 |   nt = 0;
      |   ^~
      |   n
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector <pair<int,int>>w(n);
  for (int i=0; i<n; i++){
    int a,b;
    cin >> a >> b;
    w[i] = make_pair(b,a);
  }
  w.sort(w.begin(),w.end());
  nt = 0;
  for(int i=0; i<n; i++){
    nt += w[i].second();
    if (nt > w[i].first()){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'class std::vector<std::pair<int, int> >' has no member named 'sort'
   12 |   w.sort(w.begin(),w.end());
      |     ^~~~
a.cc:13:3: error: 'nt' was not declared in this scope; did you mean 'n'?
   13 |   nt = 0;
      |   ^~
      |   n
a.cc:15:22: error: expression cannot be used as a function
   15 |     nt += w[i].second();
      |           ~~~~~~~~~~~^~
a.cc:16:24: error: expression cannot be used as a function
   16 |     if (nt > w[i].first()){
      |              ~~~~~~~~~~^~
Language: C++

#include<bits/stdc++.h>
#include<utility>
using namespace std;
int main(){
  int n;cin>>n;
  vector<pair<int,int>> tasks;
  for(int i=0;i<n;i++){
    int a,b; cin>>a >>b;
    tasks.emplace_back(b,a);
  }
  sort(tasks.begin(),tasks.end());
  int sum=0;
  bool ok=true;
  for(auto v:tasks){
    sum+=tasks.second;
    if(sum>tasks.first){
      ok=false;
      break;
    }
  }
  cout<<(ok ? "Yes" : "No")<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   15 |     sum+=tasks.second;
      |                ^~~~~~
a.cc:16:18: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   16 |     if(sum>tasks.first){
      |                  ^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#define ll long long int;

using namespace std;


int main(){

    int n;
    cin >> n;

    int a, b;
    vector<pair<int,int> > task(n);

    for(int i=0;i<n;i++){
        cin >> a >> b;
        task[i] = make_pair(b,a)
    }

    sort(task.begin(),task.end());

    int sum=0;

    for(int i=0;i<task_size();i++){
        sum += task[i].second;

        if(sum > task[i].first){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: expected ';' before '}' token
   19 |         task[i] = make_pair(b,a)
      |                                 ^
      |                                 ;
   20 |     }
      |     ~                            
a.cc:26:19: error: 'task_size' was not declared in this scope
   26 |     for(int i=0;i<task_size();i++){
      |                   ^~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#define ll long long int;

using namespace std;


int main(){

    int n;
    cin >> n;

    int a, b;
    vector<piar<int,int> > task(n);

    for(int i=0;i<n;i++){
        cin >> a >> b;
        task[i] = make_pair(b,a)
    }

    sort(task.begin(),task.end());

    int sum=0;

    for(int i=0;i<task_size();i++){
        sum += task[i].second;

        if(sum > task[i].first){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'piar' was not declared in this scope
   15 |     vector<piar<int,int> > task(n);
      |            ^~~~
a.cc:15:24: error: template argument 1 is invalid
   15 |     vector<piar<int,int> > task(n);
      |                        ^
a.cc:15:24: error: template argument 2 is invalid
a.cc:15:26: error: expected unqualified-id before '>' token
   15 |     vector<piar<int,int> > task(n);
      |                          ^
a.cc:19:9: error: 'task' was not declared in this scope
   19 |         task[i] = make_pair(b,a)
      |         ^~~~
a.cc:22:10: error: 'task' was not declared in this scope
   22 |     sort(task.begin(),task.end());
      |          ^~~~
a.cc:26:19: error: 'task_size' was not declared in this scope
   26 |     for(int i=0;i<task_size();i++){
      |                   ^~~~~~~~~
Language: Java

//package Atcoder131;

import sun.tools.jstat.Scale;

import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        List<MapElement> list = new ArrayList<>();
        while(N>0){
            list.add(new MapElement(s.nextInt(),s.nextInt()));
            N--;
        }
        list.sort(new Comparator<MapElement>() {
            @Override
            public int compare(MapElement o1, MapElement o2) {
                return o1.v < o2.v ? -1 : 1;
            }
        });
//        Consumer<MapElement> myConsumer = (m)-> System.out.println(m.k+" "+m.v);
//        list.forEach(myConsumer);
        int sum=0;
        for(int i=0;i<list.size();i++){
            sum+=list.get(i).k;
            if(sum <= list.get(i).v){
                continue;
            }else{
                System.out.println("No");
                System.exit(0);
            }
        }
        System.out.println("Yes");
    }
}

class MapElement implements Comparable<MapElement>{
    public int k;
    public int v;
    MapElement(int k , int v){
        this.k= k;
        this.v= v;
    }

    public int compareTo(MapElement me) {
        return this.v < me.v ? -1 : 1;
    }
}


Compiler output:
Main.java:3: error: package sun.tools.jstat is not visible
import sun.tools.jstat.Scale;
                ^
  (package sun.tools.jstat is declared in module jdk.jcmd, which is not in the module graph)
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main()
{
	ll A,B,N;ll sum=0;
	cin>>N;vector<pair<ll,ll>> vect;
  	for(ll i=0;i<N;i++)
    {
      cin>>A>>B;
      vect.push_back(pair<A,B>);
    }
  	sort(vect.begin(),vect.end());
  	for(ll i=0;i<N;i++)
    {
      sum+=vect[i].first;
      if(sum>vect[i].second)
        cout<<"No"<<endl;
      return 0;
    }
  	cout<<"Yes"<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: type/value mismatch at argument 1 in template parameter list for 'template<class _T1, class _T2> struct std::pair'
   12 |       vect.push_back(pair<A,B>);
      |                              ^
a.cc:12:30: note:   expected a type, got 'A'
a.cc:12:30: error: type/value mismatch at argument 2 in template parameter list for 'template<class _T1, class _T2> struct std::pair'
a.cc:12:30: note:   expected a type, got 'B'
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	vector<pair<int, int>> task(N);
	for(int i = 0; i < N; i++){
		cin >> task[i].second >> task[i].first(i);
	}
	
	sort(task.begin(), task.end());//締め切りの早い順にソート
	
	int deadline;//締め切り時間のカウント
	int count = 0;//現在の時刻(仕事にかかった時間の累積)
	bool judge = true;
	string can = "Yes";
	string cant = "No";
	
	for(int i = 0; i < N; i++){
		deadline = task[i].first;
		count += task[i].second;
		if(deadline < count){
			judge = false;
			break;
		}
	}
	
	if(judge){
		cout << can << endl;
	} else {
		cout << cant << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:55: error: expression cannot be used as a function
    9 |                 cin >> task[i].second >> task[i].first(i);
      |                                          ~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	vector<pair<int, int>> task(N);
	for(int i = 0; i < N; i++){
		cin >> task[i].second >> task[i].first(i);
	}
	
	sort(task.begin(), task.end());
	
	int deadline = 0;
	bool judge = true;
	string can = "Yes";
	string cant = "No";
	
	for(int i = 0; i < N; i++){
		deadline += task[i].first;
		if(deadline < task[i].second){
			judge = false;
			break;
		}
	}
	
	if(judge){
		cout << can << endl;
	} else {
		cout << cant << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:55: error: expression cannot be used as a function
    9 |                 cin >> task[i].second >> task[i].first(i);
      |                                          ~~~~~~~~~~~~~^~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    int n;
    P[] ps;


    void run() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        ps = new P[n];

        long t = 0;
        for (int i = 0; i < n; i++) {
            ps[i] = new P(sc.nextLong(), sc.nextLong());
            t += ps[i].a;
        }

        Arrays.sort(ps);
        for (int i = 0; i < n; i++) {
            if (t > ps[i].b) t = ps[i].b;
            if (t - ps[i].a < 0) {
                System.out.println("No");
                return;
            }
            t -= ps[i].a;
        }

        System.out.println("Yes");
    }

    class P implements Comparable<P> {
        long a, b;
        P(long a, long b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(P o) {
            return (int)(o.b - b)
        }
    }


    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


Compiler output:
Main.java:43: error: ';' expected
            return (int)(o.b - b)
                                 ^
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
 
    int n;
    P[] ps;
 
 
    void run() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        ps = new P[n];
 
        long t = 0;
        for (int i = 0; i < n; i++) {
            ps[i] = new P(sc.nextLong(), sc.nextLong());
            t += ps[i].a;
        }
 
        Arrays.sort(ps);
        for (int i = 0; i < n; i++) {
            if (t > ps[i].b) t = ps[i].b;
            if (t - ps[i].a < 0) {
                System.out.println("No");
                return;
            }
            t -= ps[i].a;
        }
 
        System.out.println("Yes");
    }
 
    class P implements Comparable<P> {
        long a, b;
        P(long a, long b) {
            this.a = a;
            this.b = b;
        }
 
        @Override
        public long compareTo(P o) {
            return o.b - b;
        }
    }
 
 
    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }
 
    public static void main(String[] args) {
        new Main().run();
    }
}

Compiler output:
Main.java:34: error: Main.P is not abstract and does not override abstract method compareTo(Main.P) in Comparable
    class P implements Comparable<P> {
    ^
Main.java:42: error: compareTo(Main.P) in Main.P cannot implement compareTo(T) in Comparable
        public long compareTo(P o) {
                    ^
  return type long is not compatible with int
  where T is a type-variable:
    T extends Object declared in interface Comparable
Main.java:41: error: method does not override or implement a method from a supertype
        @Override
        ^
3 errors
Language: Java

import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
 
    int n;
    P[] ps;
 
 
    void run() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        ps = new P[n];
 
        long t = 0;
        for (int i = 0; i < n; i++) {
            ps[i] = new P(sc.nextLong(), sc.nextLong());
            t += ps[i].a;
        }
 
        Arrays.sort(ps);
        for (int i = 0; i < n; i++) {
            if (t > ps[i].b) t = ps[i].b;
            if (t - ps[i].a < 0) {
                System.out.println("No");
                return;
            }
            t -= ps[i].a;
        }
 
        System.out.println("Yes");
    }
 
    class P implements Comparable<P> {
        long a, b;
        P(long a, long b) {
            this.a = a;
            this.b = b;
        }
 
        @Override
        public int compareTo(P o) {
            return o.b - this.b;
        }
    }
 
 
    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }
 
    public static void main(String[] args) {
        new Main().run();
    }
}

Compiler output:
Main.java:43: error: incompatible types: possible lossy conversion from long to int
            return o.b - this.b;
                       ^
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
 
    int n;
    P[] ps;
 
 
    void run() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        ps = new P[n];
 
        long t = 0;
        for (int i = 0; i < n; i++) {
            ps[i] = new P(sc.nextLong(), sc.nextLong());
            t += ps[i].a;
        }
 
        Arrays.sort(ps);
        for (int i = 0; i < n; i++) {
            if (t > ps[i].b) t = ps[i].b;
            if (t - ps[i].a < 0) {
                System.out.println("No");
                return;
            }
            t -= ps[i].a;
        }
 
        System.out.println("Yes");
    }
 
    class P implements Comparable<P> {
        long a, b;
        P(long a, long b) {
            this.a = a;
            this.b = b;
        }
 
        @Override
        public int compareTo(P o) {
            return o.b - b;
        }
    }
 
 
    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }
 
    public static void main(String[] args) {
        new Main().run();
    }
}

Compiler output:
Main.java:43: error: incompatible types: possible lossy conversion from long to int
            return o.b - b;
                       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pair<int, int> pair1;

int main()
{
  	int a,b,n,i; cin>>n;
  	vector<pair1> something[n];
  	for(i=0;i<n;i++)
      cin>>something[i].second>>something[i].first;
  	sort(something.begin(),something.end());
  	int sum=0; bool f = true;
  	for(i=0;i<n;i++)
    {
      sum+=p[i].second();
      if(sum>p[i].first())
      {f=false;break;}
    }
  	cout<<(f?"Yes":"No")<<endl;
  	return 0;
}

Compiler output:
a.cc:3:9: warning: ISO C++11 requires whitespace after the macro name
    3 | #define pair<int, int> pair1;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:8:16: error: 'pair1' was not declared in this scope; did you mean 'pair'?
    8 |         vector<pair1> something[n];
      |                ^~~~~
      |                pair
a.cc:8:21: error: template argument 1 is invalid
    8 |         vector<pair1> something[n];
      |                     ^
a.cc:8:21: error: template argument 2 is invalid
a.cc:10:25: error: request for member 'second' in 'something[i]', which is of non-class type 'int'
   10 |       cin>>something[i].second>>something[i].first;
      |                         ^~~~~~
a.cc:10:46: error: request for member 'first' in 'something[i]', which is of non-class type 'int'
   10 |       cin>>something[i].second>>something[i].first;
      |                                              ^~~~~
a.cc:11:24: error: request for member 'begin' in 'something', which is of non-class type 'int [n]'
   11 |         sort(something.begin(),something.end());
      |                        ^~~~~
a.cc:11:42: error: request for member 'end' in 'something', which is of non-class type 'int [n]'
   11 |         sort(something.begin(),something.end());
      |                                          ^~~
a.cc:15:12: error: 'p' was not declared in this scope
   15 |       sum+=p[i].second();
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pair1;

int main()
{
  	int a,b,n,i; cin>>n;
  	vector<pair1> something[n];
  	for(i=0;i<n;i++)
      cin>>something[i].second>>something[i].first;
  	sort(something.begin(),something.end());
  	int sum=0; bool f = true;
  	for(i=0;i<n;i++)
    {
      sum+=p[i].second();
      if(sum>p[i].first())
      {f=false;break;}
    }
  	cout<<(f?"Yes":"No")<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   10 |       cin>>something[i].second>>something[i].first;
      |                         ^~~~~~
a.cc:10:46: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   10 |       cin>>something[i].second>>something[i].first;
      |                                              ^~~~~
a.cc:11:24: error: request for member 'begin' in 'something', which is of non-class type 'std::vector<std::pair<int, int> > [n]'
   11 |         sort(something.begin(),something.end());
      |                        ^~~~~
a.cc:11:42: error: request for member 'end' in 'something', which is of non-class type 'std::vector<std::pair<int, int> > [n]'
   11 |         sort(something.begin(),something.end());
      |                                          ^~~
a.cc:15:12: error: 'p' was not declared in this scope
   15 |       sum+=p[i].second();
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pair;

int main()
{
  	int a,b,n,i; cin>>n;
  	vector<pair> something[n];
  	for(i=0;i<n;i++)
      cin>>something[i].second>>something[i].first;
  	sort(something.begin(),something.end());
  	int sum=0; bool f = true;
  	for(i=0;i<n;i++)
    {
      sum+=p[i].second();
      if(sum>p[i].first())
      {f=false;break;}
    }
  	cout<<(f?"Yes":"No")<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: template argument 1 is invalid
    8 |         vector<pair> something[n];
      |                    ^
a.cc:8:20: error: template argument 2 is invalid
a.cc:10:25: error: request for member 'second' in 'something[i]', which is of non-class type 'int'
   10 |       cin>>something[i].second>>something[i].first;
      |                         ^~~~~~
a.cc:10:46: error: request for member 'first' in 'something[i]', which is of non-class type 'int'
   10 |       cin>>something[i].second>>something[i].first;
      |                                              ^~~~~
a.cc:11:24: error: request for member 'begin' in 'something', which is of non-class type 'int [n]'
   11 |         sort(something.begin(),something.end());
      |                        ^~~~~
a.cc:11:42: error: request for member 'end' in 'something', which is of non-class type 'int [n]'
   11 |         sort(something.begin(),something.end());
      |                                          ^~~
a.cc:15:12: error: 'p' was not declared in this scope
   15 |       sum+=p[i].second();
      |            ^