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

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define ARR(array) for(int i=0;i<array.size();i++)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 1e18
#define MOD 1000000007
#define SIZE 10005
#define PI 	3.14159265358979323846

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; } //最小公約数
ll lcm(ll a, ll b) { return a/gcd(a, b)*b; } //最大公倍数

ll input(){
  ll a;
  cin >> a;
  return a;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;
    cin >> n >> m;

    list<P> lst;
    REP(i,n){
      P A;
      cin >> A.first >> A.second;
       lst.push_front(A);
    }

    ll ans = 0;
    lst.sort();
    FOR(i,1,n+1){
      auto kill = lst.begin();
      for(auto itr = lst.begin(); itr != lst.end(); ++it){
        if(*itr.first > i)break;
        if(*itr.second > *kill.second)kill = itr;
      }
      ans += *kill.second;
      lst.erase(kill);
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:55: error: 'it' was not declared in this scope; did you mean 'itr'?
   47 |       for(auto itr = lst.begin(); itr != lst.end(); ++it){
      |                                                       ^~
      |                                                       itr
a.cc:48:17: error: 'struct std::_List_iterator<std::pair<long long int, long long int> >' has no member named 'first'
   48 |         if(*itr.first > i)break;
      |                 ^~~~~
a.cc:49:17: error: 'struct std::_List_iterator<std::pair<long long int, long long int> >' has no member named 'second'
   49 |         if(*itr.second > *kill.second)kill = itr;
      |                 ^~~~~~
a.cc:49:32: error: 'struct std::_List_iterator<std::pair<long long int, long long int> >' has no member named 'second'
   49 |         if(*itr.second > *kill.second)kill = itr;
      |                                ^~~~~~
a.cc:51:20: error: 'struct std::_List_iterator<std::pair<long long int, long long int> >' has no member named 'second'
   51 |       ans += *kill.second;
      |                    ^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int N,M,f,s,st=0;
    long long int ans =0,mm=0,sum=0;

    pair<int,int> p;
    cin >> N >> M;
    mm = M;
    for(int i=1;i<M;++){
        M--;
        mm *= M; 
    }

    vector<int> fl(M,0);
    vector<pair<int,int>> arr(N);

    for(int i=0;i<N;i++){
        cin >> p.second >> p.first;
        arr[i] = p;
    }

    sort(arr.begin(),arr.end());
    reverse(arr.begin(),arr.end());

    for(int i=0;i<M;i++){
        if(sum+arr[i].second<=mm){
            ans += arr[i].first;
            sum += arr.second;
        }

        }

    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected primary-expression before ')' token
   12 |     for(int i=1;i<M;++){
      |                       ^
a.cc:31:24: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   31 |             sum += arr.second;
      |                        ^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int N,M,f,s,st=0;
    long long int ans =0,mm=0,sum=0;

    pair<int,int> p;
    cin >> N >> M;
    mm = M;
    for(int i=1;i<M;++){
        M--;
        mm *= M; 
    }

    vector<int> fl(M,0);
    vector<pair<int,int>> arr(N);

    for(int i=0;i<N;i++){
        cin >> p.second >> p.first;
        arr[i] = p;
    }

    sort(arr.begin(),arr.end());
    reverse(arr.begin(),arr.end());

    for(int i=0;i<M;i++){
        if(sum+arr[i].second<=mm){
            ans += arr[i].first;
            sum += arr.second;
        }

        }
    }

    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected primary-expression before ')' token
   12 |     for(int i=1;i<M;++){
      |                       ^
a.cc:31:24: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   31 |             sum += arr.second;
      |                        ^~~~~~
a.cc: At global scope:
a.cc:37:5: error: 'cout' does not name a type
   37 |     cout << ans << endl;
      |     ^~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: Java

import java.util.Scanner;
import java.util.HashMap;
import java.util.Map;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.List;
import java.util.ArrayList;
import java.uitil.Comparator;

public class Main { //クラス名はMain
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      PrintWriter out = new PrintWriter(System.out);
      String[] paras = sc.next().split(" ");
      int n = Integer.parseInt(paras[0]);
      int m = Integer.parseInt(paras[1]);
      Map<Integer,List<Integer>> map = new HashMap<>();
      for(int i = 0;i<n;i++){
        String[] reward = sc.next().split(" ");
        int day = Integer.parseInt(reward[0]);
        int num = Integer.parseInt(reward[1]);
        if(day > m) continue;
        if(map.containsKey(day)){
          List<Integer> l = map.get(day);
          l.add(num);
          map.put(day,l);
        }else{
          List<Integer> l = new ArrayList<>();
          l.add(num);
          map.put(day,l);
        }
      }
      
      int[] taken = new int[m+1];
      for(int i = m;i>=1;i--){
        if(map.containsKey(i)){
          List<Integer> l = map.get(i);
          Collections.sort(l,Comparator.reverseOrder());
          map.put(i,l);
        }else taken[i] = -1;
      }
      
      long ans = 0;
      for(int i = m;i>=1;i--){
        int max = 0;
        int last = 0;
        for(j = i;j<=m;j++){
          if(taken[i] < 0) continue;
          List<Integer> l = map.get(j);
          if(taken[i] >=l.size()) continue;
          if(l.get(taken[i]) > max){
            max = taken[i];
            taken[last]--;
            taken[i]++;
            last = i;
          }
        }
        ans += max;
      }
      
      out.println(ans);
      out.flush();
    }
}


Compiler output:
Main.java:8: error: package java.uitil does not exist
import java.uitil.Comparator;
                 ^
Main.java:38: error: cannot find symbol
          Collections.sort(l,Comparator.reverseOrder());
                             ^
  symbol:   variable Comparator
  location: class Main
Main.java:47: error: cannot find symbol
        for(j = i;j<=m;j++){
            ^
  symbol:   variable j
  location: class Main
Main.java:47: error: cannot find symbol
        for(j = i;j<=m;j++){
                  ^
  symbol:   variable j
  location: class Main
Main.java:47: error: cannot find symbol
        for(j = i;j<=m;j++){
                       ^
  symbol:   variable j
  location: class Main
Main.java:49: error: cannot find symbol
          List<Integer> l = map.get(j);
                                    ^
  symbol:   variable j
  location: class Main
6 errors
Language: Java

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

public class Atcoder137 {

    static class node implements Comparable<node>{
        int days;
        int money;

        public int compareTo(node o) {
            if(this.money==o.money){
                return o.days-this.days;
            }
            return -(this.money-o.money);
        }
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        int day = in.nextInt();

        node n[] = new node[t];

        for(int i=0;i<t;i++){
            int x = in.nextInt();
            int y = in.nextInt();
            node newnode = new node();
            newnode.days=x;
            newnode.money=y;
            n[i]=newnode;
        }

        Arrays.sort(n);

//        for(int i=0;i<t;i++){
//            System.out.println(n[i].days+" "+n[i].money);
//        }

        System.out.println(returnAns(n,day));

    }

    public static int returnAns(node[] n,int day){
        int ans =0;

        int days = day;

        for(int i=0;i<n.length;i++){

//            System.out.println(i-1);
            if(n[i].days-(days-i)<=0 ){
                ans += n[i].money;
            }
        }

        return ans;
    }
}


Compiler output:
Main.java:4: error: class Atcoder137 is public, should be declared in a file named Atcoder137.java
public class Atcoder137 {
       ^
1 error
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,0,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  ll N,M,ans=0,t=0;
  cin>>N>>M;
  vector<pair<int,int>> AB;
  REP(i,N){
    int a,b;
    cin>>a>>b;
    AB.push_back(make_pair(b,a));
  }
  
  SORT(AB);
  REVERSE(AB);
  
  for(ll i=0; i<M; ++i){
    for(ll j=t; j<N; ++j){
      if(AB[j].second+i<=M){
        ans+=AB[j].first;
        t=j;
        AB[j].first=0;
        CAN=true;
        break;
      }
    }
    if(t==N-1) break;
  }
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: 'CAN' was not declared in this scope; did you mean 'NAN'?
   38 |         CAN=true;
      |         ^~~
      |         NAN
Language: C++

#include <bits/stdc++.h>
using namespace std;
bool func(pair<int,int> a, pair<int,int> b){
  if(a.first==b.first){
  return (a.second>b.second)
  }
return (a.first>b.first);
  
}
int main(){
int n,m,a,b;
  cin>>n>>m;
  vector<pair<int,int>> din_paisa;
  //vector<int> paisa;
  for(int i=0;i<n;i++){
  cin>>a>>b;
    if(a>m){
    continue;}
    else{
    din_paisa.push_back({a,b});
    }
  }
  sort(din_paisa.begin(),din_paisa.end(),func);
//   for(int i=0;i<din_paisa.size();i++){
//   cout<<din_paisa[i].first<<" "<<din_paisa[i].second<<endl;
//   }
  long long ans=0;
  for(int i=0;i<din_paisa.size();i++){
  int din=din_paisa[i].first;
    int paisa=din_paisa[i].second;
    if((i+din)<=m){
    ans+=(long long)paisa;
    }
    else{
        m++;
    }
  }
  cout<<ans;
return 0;
}


Compiler output:
a.cc: In function 'bool func(std::pair<int, int>, std::pair<int, int>)':
a.cc:5:29: error: expected ';' before '}' token
    5 |   return (a.second>b.second)
      |                             ^
      |                             ;
    6 |   }
      |   ~
Language: Java

import java.util.Scanner;
import java.util.HashMap;
import java.util.Map;
import java.io.PrintWriter;

public class Main { //クラス名はMain
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      PrintWriter out = new PrintWriter(System.out);
      String[] paras = sc.next().split(" ");
      int n = Integer.parseInt(paras[0]);
      int m = Integer.parseInt(paras[1]);
      Map<Integer,List<Integer>> map = new HashMap<>();
      for(int i = 0;i<n;i++){
        String[] reward = sc.next().split(" ");
        int day = Integer.parseInt(reward[0]);
        int num = Integer.parseInt(reward[1]);
        if(day > m) continue;
        if(map.containsKey(day)){
          List<Integer> l = map.get(day);
          l.add(num);
          map.put(day,l);
        }else{
          List<Integer> l = new ArrayList<>();
          l.add(num);
          map.put(day,l);
        }
      }
      
      int[] taken = new int[m+1];
      for(int i = m;i>=1;i--){
        if(map.containsKey(i)){
          List<Integer> l = map.get(i);
          Collections.sort(l，Comparator.reverseOrder());
          map.put(i,l);
        }else taken[i] = -1;
      }
      
      long ans = 0;
      for(int i = m;i>=1;i--){
        int max = 0;
        int last = 0;
        for(j = i;j<=m;j++){
          if(taken[i] < 0) continue;
          List<Integer> l = map.get(j);
          if(taken[i] >=l.size()) continue;
          if(l.get(taken[i]) > max){
            max = taken[i];
            taken[last]--;
            taken[i]++;
            last = i;
          }
        }
        ans += max;
      }
      
      out.println(ans);
      out.flush();
    }
}


Compiler output:
Main.java:34: error: illegal character: '\uff0c'
          Collections.sort(l?Comparator.reverseOrder());
                            ^
Main.java:34: error: ';' expected
          Collections.sort(l?Comparator.reverseOrder());
                                                      ^
2 errors
Language: C

#include <stdio.h>
#include <stdlib.h>

typedef struct Data{
  long time;
  long money;
}Data;

int compare(const void *a,const void *b){
  Data *A = (Data *)a;
  Data *B = (Data *)b;
  long ta = A->time;
  long tb = B->time;
  long ma = A->money;
  long mb = B->money;
  if((mb*100001+tb) - (ma*100001+ta) > 0){
    return 1;
  }else if((mb*100001+tb) - (ma*100001+ta) < 0){
    return -1;
  }else{
    return 0;
  }
}

int main(){
  long n,m;
  scanf("%ld %ld",&n,&m);
  Data info[100000];
  long a,b;
  for(int i=0;i<n;i++){
    scanf("%ld %ld",&a,&b);
    info[i].time = a - 1;
    info[i].money = b;
  }
  qsort(info,n,sizeof(Data),compare);
  /*
  for(int i=0;i<n;i++){
    a = info[i].time;
    b = info[i].money;
    printf("%ld %ld\n",a,b);
  }
  */
  long reward = 0;
  long task = 0;
  bool sche[100000];
  for(int i=0;i<m;i++){
    sche[i] = true;
  }
  int tmp;
  bool done;
  for(int i=0;i<n;i++){
    a = info[i].time;
    b = info[i].money;
    tmp = a;
    while(tmp < m){
      if(sche[tmp]){
        sche[tmp] = false;
        reward += b;
        break;
      }
      tmp++;
    }
  }
  printf("%ld\n",reward);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:45:3: error: unknown type name 'bool'
   45 |   bool sche[100000];
      |   ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <stdlib.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:47:15: error: 'true' undeclared (first use in this function)
   47 |     sche[i] = true;
      |               ^~~~
main.c:47:15: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:47:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:50:3: error: unknown type name 'bool'
   50 |   bool done;
      |   ^~~~
main.c:50:3: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:57:21: error: 'false' undeclared (first use in this function)
   57 |         sche[tmp] = false;
      |                     ^~~~~
main.c:57:21: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++


#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;

typedef pair<int, int> P;
int main(){
  int n, m;
  cin >> n >> m;

  int ans = 0;
  P work[n];

  //開始時間
  for (int i = 0; i < n; i++) {
    //受け取るまでの日数, 報酬
    cin >> work[i].second >> work[i].first;
  }

  //報酬が多い順にソート

  sort(work, work+n,greater<pair<int,int> >());

  for (int i = 0; i < n; i++) {
    //仕事iの報酬Getの時が終了日以内なら
    if (work[i].second + i <= m) {
      ans += work[i].first;
    }
  }

  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |   sort(work, work+n,greater<pair<int,int> >());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <vector>
#include <utility>
using namespace std;

bool cmp(pair<int,int> a,pair<int,int> b){
    if(a.second!=b.second){
        return a.second<b.second;
    }
    else{
        return a.first < b.first;
    }
}

int main(){
    int n,m;
    cin >> n >> m;
    vector<pair<int,int> > in;
    for(int i=0;i<n;i++){
        int a,b;
        cin >> a >> b;
        in.push_back(make_pair(a,b));
    }
    sort(in.begin(),in.end(),cmp);
    reverse(in.begin(),in.end());

    int now = 0;
    long long ans = 0;
    while(now < m && !in.empty()){
        if(in[0].first+now <= m){
            ans += in[0].second;
            in.erase(in.begin());
            now ++;
        }
        else{
            in.erase(in.begin());
        }
    }
    cout << ans <<endl;
    return 0;
}

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

#include <iostream>
#include <vector>
using namespace std;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second > b.second;
    }else{
        return a.first < b.first;
    }
}

int main(){
    int N, M;
    cin >> N >> M;
    
    vector<pair<int, int>> AB(N);
    for(int i = 0; i < N; ++i){
        cin >> AB[i].first >> AB[i].second;
    }

    sort(begin(AB), end(AB), compare_by_b);
    
    vector<bool> state(N+1, false);
    long long int ans = 0;
    int cnt = 0;
    for(int i = 0; i < N; ++i){
        if(cnt == N){
            break;
        }
        if(M-AB[i].first >= 0){
            if(!state[M-AB[i].first]){
                state[M-AB[i].first] = true;
                ans += AB[i].second;
                ++cnt;
            }else{
                for(int j = M-AB[i].first-1; j >= 0; --j){
                    if(!state[j]){
                       state[j] = true;
                       ans += AB[i].second;
                       ++cnt;
                       break;
                    }
                }
            }
        }
    }

    cout << ans << endl;
}

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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,0,n)
#define SORT(V) sort((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  ll N,M,ans=0,t=N-1;
  cin>>N>>M;
  vector<pair<int,int>> AB;
  REP(i,N){
    int a,b;
    cin>>a>>b;
    AB.push_back(make_pair(a,b));
  }
  
  SORT(AB);
  
  for(int i=0; i<M; ++i){
    for(int j=t; j>=0 --j){
      if(AB[j].first+i<=M){
        ans+=AB[j].second;
        t=j;
        AB[j].second=0;
      }
    }
  }
  
  
  
  
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:21: error: lvalue required as decrement operand
   31 |     for(int j=t; j>=0 --j){
      |                     ^
a.cc:31:25: error: expected ';' before 'j'
   31 |     for(int j=t; j>=0 --j){
      |                         ^
      |                         ;
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,0,n)
#define SORT(V) sort((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  ll N,M,ans=0,t=N-1;
  cin>>N>>M;
  vector<pair<int,int>>; AB;
  REP(i,N){
    int a,b;
    cin>>a>>b;
    AB.push_back(make_pair(a,b));
  }
  
  SORT(AB);
  
  for(int i=0; i<M; ++i){
    for(int j=t; j>=0 --j){
      if(AB[j].first+i<=M){
        ans+=AB[j].second;
        t=j;
        AB[j].second=0;
      }
    }
  }
  
  
  
  
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: declaration does not declare anything [-fpermissive]
   21 |   vector<pair<int,int>>; AB;
      |   ^~~~~~~~~~~~~~~~~~~~~
a.cc:21:26: error: 'AB' was not declared in this scope
   21 |   vector<pair<int,int>>; AB;
      |                          ^~
a.cc:31:21: error: lvalue required as decrement operand
   31 |     for(int j=t; j>=0 --j){
      |                     ^
a.cc:31:25: error: expected ';' before 'j'
   31 |     for(int j=t; j>=0 --j){
      |                         ^
      |                         ;
Language: C++

#include <iostream>
#include <queue>
using namespace std;

int main(){
    int n,m;
    cin>>n>>m;
    pair<int,int> a[n];
    priority_queue<int> pq;
    for(int i=0;i<n;i++){
        cin>>a[i].first>>a[i].second;
    }
    sort(a,a+n);
    int res=0,j=0;
    for(int i=m-1;i>=0;i--){
        while(j<n && a[j].first<=m-i){
            pq.push(a[j].second);
            j++;
        }
        if(pq.size()){
            res+=pq.top();
            pq.pop();
        }
    }
    cout<<res<<"\n";
    return 0;
}

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

#include <cmath>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;


int main(){
    int N, M;
    int date = 0;
    int ans = 0;
    int index = 0;

    cin >> N >> M;

    int A[N];
    int B[N];
    double e[N];
    vector<pair<int, int> > p;

    for(int i = 0; i < N; i++){
        cin >> A[i] >> B[i];
        p.push_back(make_pair(B[i], A[i]));
    }

    sort(p.begin(), p.end(), greater<pair<int, int> >());

    while(index < N){
        while(date + p[index].second > M){
            index++;
            if(index >= N){
                break;
            }
        }
        if(index < N){
            ans += p[index].first;
            date++;
            index++;
        }
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   28 |     sort(p.begin(), p.end(), greater<pair<int, int> >());
      |     ^~~~
      |     sqrt
Language: C++

#include <bits/stdc++.h>
#define maxn 100005
#define ll long long
using namespace std;
const int N = 1e5 + 7;
vector <ll> v;
int main()
{
    ll n, m, x, y, mx = 0; cin >> n >> m;
    ll ans = 0;
    for(int i = 1; i <= n; i++)
    {
        scanf("%lld%lld", &x, &y);
        if(x == m) mx = max(mx, y);
        else if(x < m) v.push_back(y);
    }
    v.push_back(mx);
    sort(v.begin(), v.end());
    int p = v.size();
    int k = max(p - m, 0);
    for(int i = p - 1; i >= k; i--)
        ans += v.at(i);
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: no matching function for call to 'max(long long int, int)'
   20 |     int k = max(p - m, 0);
      |             ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:20:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |     int k = max(p - m, 0);
      |             ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:20:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |     int k = max(p - m, 0);
      |             ~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll md = 1000000007;

int main(int, char**)
{
	ll ans = 0;
	int n, m;
	cin >> n >> m;

	vector<priority_queue<int>> x(m+2);
	for(int i = 0; i < n; ++i) {
		ll a, b;
		cin >> a >> b;
		if (b > m) continue;
		x[a].push(b);
	}
	for(int i = 1; i <= m; ++i) {
		if (x[i].empty()) continue;
		ans += x[i].top();
		x[i].pop();
		while( ! x[i].empty() && (x[i+1].size <= m - i + 1)) {
			x[i+1].push(x[i].top());
			x[i].pop();
		}
	}

	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:26:50: error: invalid use of member function 'std::priority_queue<_Tp, _Sequence, _Compare>::size_type std::priority_queue<_Tp, _Sequence, _Compare>::size() const [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   26 |                 while( ! x[i].empty() && (x[i+1].size <= m - i + 1)) {
      |                                                      ()
Language: C++


#include <iostream>
 
using namespace std;
const int ll=1e9;
int cb=0,nb=0,v[ll],m[ll][ll],w[ll],x[ll];
//计算背包可以装下的最大价值
void Kinapsack(int v[],int w[],int c,int n,int m[ll][ll])   //只有一维数组可以用[]，二维及多维数组要给定数组大小
{
    int jMax=min(w[n]-1,c);
    for(int j=0;j<jMax;j++) m[n][j]=0;
    for(int j=w[n];j<=c;j++) m[n][j]=v[n];
    for(int i=n-1;i>1;i--)
    {
        jMax=min(w[i]-1,c);
        for(int j=0;j<=jMax;j++) m[i][j]=m[i+1][j];
        for(int j=w[i];j<=c;j--) m[i][j]=max(m[i+1][j],m[i+1][j-w[i]]+v[i]);
    }
    m[1][c]=m[2][c];
    if(c>=w[1]) m[1][c]=max(m[1][c],m[2][c-w[1]]+v[1]);
}
//给装进背包里的物品标记为1，未装进的标记为0
void Traceback(int m[100][100],int w[],int c,int n,int x[])
{
    for(int i=1;i<n;i++)
        if(m[i][c]==m[i+1][c]) x[i]=0;
        else {x[i]=1;c-=w[i];}
        x[n]=(m[n][c])?1:0;
}
 
int main()
{
    cin>>cb;
    cin>>nb;
    for(int i=1;i<=nb;i++)
    {
        cin>>w[i]>>v[i];
    }
    Kinapsack(v,w,cb,nb,m);
    cout<<m[1][cb]<<endl;
    return 0;
}

Compiler output:
/tmp/cc9RuEGD.o: in function `main':
a.cc:(.text+0x4a4): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cc9RuEGD.o
a.cc:(.text+0x500): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc9RuEGD.o
a.cc:(.text+0x50b): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cc9RuEGD.o
a.cc:(.text+0x53a): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc9RuEGD.o
collect2: error: ld returned 1 exit status
Language: C++


#include <iostream>
 
using namespace std;
const int ll=1e9;
int cb=0,nb=0,v[ll],m[ll][ll],w[ll],x[ll];
//计算背包可以装下的最大价值
void Kinapsack(int v[],int w[],int c,int n,int m[100][100])   //只有一维数组可以用[]，二维及多维数组要给定数组大小
{
    int jMax=min(w[n]-1,c);
    for(int j=0;j<jMax;j++) m[n][j]=0;
    for(int j=w[n];j<=c;j++) m[n][j]=v[n];
    for(int i=n-1;i>1;i--)
    {
        jMax=min(w[i]-1,c);
        for(int j=0;j<=jMax;j++) m[i][j]=m[i+1][j];
        for(int j=w[i];j<=c;j--) m[i][j]=max(m[i+1][j],m[i+1][j-w[i]]+v[i]);
    }
    m[1][c]=m[2][c];
    if(c>=w[1]) m[1][c]=max(m[1][c],m[2][c-w[1]]+v[1]);
}
//给装进背包里的物品标记为1，未装进的标记为0
void Traceback(int m[100][100],int w[],int c,int n,int x[])
{
    for(int i=1;i<n;i++)
        if(m[i][c]==m[i+1][c]) x[i]=0;
        else {x[i]=1;c-=w[i];}
        x[n]=(m[n][c])?1:0;
}
 
int main()
{
    cin>>cb;
    cin>>nb;
    for(int i=1;i<=nb;i++)
    {
        cin>>w[i]>>v[i];
    }
    Kinapsack(v,w,cb,nb,m);
    cout<<m[1][cb]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:25: error: cannot convert 'int (*)[1000000000]' to 'int (*)[100]'
   39 |     Kinapsack(v,w,cb,nb,m);
      |                         ^
      |                         |
      |                         int (*)[1000000000]
a.cc:8:48: note:   initializing argument 5 of 'void Kinapsack(int*, int*, int, int, int (*)[100])'
    8 | void Kinapsack(int v[],int w[],int c,int n,int m[100][100])   //只有一维数组可以用[]，二维及多维数组要给定数组大小
      |                                            ~~~~^~~~~~~~~~~
Language: C++

int main() {
	int n, m;
	int ans = 0;
	int tmp = 0;

	std::cin >> n >> m;

	int *a = new int[n+1];
	int *b = new int[n+1];

	a[0] = 0;
	b[0] = 0;

	for (int i = 1; i <= n; i++) {

		std::cin >> a[i] >> b[i];
	}

	for (int i = 0; i < m; i++) {
		tmp = 0;
		for (int j = 1; j <= n; j++) {
			//for()
			if (i >= a[j]) {
				if (b[tmp] < b[j]) {

					tmp = j;
				}
				else if (a[tmp] < a[j] && b[tmp] == b[j]) {
					tmp = j;
				}
			}

		}

		ans += b[tmp];
		b[tmp] = 0;
	}


	std::cout << ans << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'cin' is not a member of 'std'
    6 |         std::cin >> n >> m;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main() {
a.cc:16:22: error: 'cin' is not a member of 'std'
   16 |                 std::cin >> a[i] >> b[i];
      |                      ^~~
a.cc:16:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:40:14: error: 'cout' is not a member of 'std'
   40 |         std::cout << ans << std::endl;
      |              ^~~~
a.cc:40:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:40:34: error: 'endl' is not a member of 'std'
   40 |         std::cout << ans << std::endl;
      |                                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main() {
Language: C++

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

int n, m;
vector<pair<int, int> > vec;

bool cmp(const pair<int, int> &x, const pair<int, int> &y)
{
	if (x.second == y.second)
		return x.first > y.first;
	return x.second > y.second;
}

int main()
{
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		vec.push_back(make_pair<int, int>(a, b));
	}
	sort(vec.begin(), vec.end(), cmp);
	int ans = 0, day = 0;
	for (int i = 0; i < n; i++) {
		if (day + vec[i].first <= m) {
			ans += vec[i].second;
		}
		day++;
	}
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:51: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
   20 |                 vec.push_back(make_pair<int, int>(a, b));
      |                                                   ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = int; _T2 = int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = int; typename decay<_Tp>::type = int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = int; typename decay<_Tp2>::type = int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~
Language: C

#include<stdio.h>
int main(){
int N,M,i,A[100000],B[100000],b=B[0],c=0;
scanf("%d %d",&N,&M);
for(i=1;i<=N;i++)
{scanf("%d %d",&A[i-1],&B[i-1]);
if(b[i]>b[i-1])b=B[i];
if(M>=A[i-1])c+=b
printf("%d",c);
}
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: subscripted value is neither array nor pointer nor vector
    7 | if(b[i]>b[i-1])b=B[i];
      |     ^
main.c:7:10: error: subscripted value is neither array nor pointer nor vector
    7 | if(b[i]>b[i-1])b=B[i];
      |          ^
main.c:8:18: error: expected ';' before 'printf'
    8 | if(M>=A[i-1])c+=b
      |                  ^
      |                  ;
    9 | printf("%d",c);
      | ~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define pback push_back
#define mpair make_pair
#define MODN 1000000007

using namespace std;


int main(){


    int n,m;
    cin >> n >> m;

    vector<pair<int,int>> works;
    vector<int> schedule;

    //添字でmまで扱いたいため
    rep(i,m + 1){
        schedule.pback(0);
    }

    rep(i,n){
        int a,b;
        cin >> a >> b;

        works.pback(mpair(a,b));
    }

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

    priority_queue<int> pq;

    int workcount = 0;

    for(int i = 1; i <= m; i++){

        while(works[workcount].first == i){
            pq.push(works[workcount].second);
            workcount++;
        }

        if(!pq.empty()){
            schedule[i] = pq.front();
            pq.pop();
        }
    }

    int ans = 0;

    rep(i,m){
        ans = ans + schedule[i + 1];
    }

    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:30: error: 'class std::priority_queue<int>' has no member named 'front'
   46 |             schedule[i] = pq.front();
      |                              ^~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define pback push_back
#define mpair make_pair
#define MODN 1000000007

using namespace std;


int main(){


    int n,m;
    cin >> n >> m;

    vector<pair<int,int>> works;
    vector<int> schedule;

    //添字でmまで扱いたいため
    rep(i,m + 1){
        schedule.pback(0);
    }

    rep(i,n){
        int a,b;
        cin >> a >> b;

        works.pback(mpair(a,b));
    }

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

    priority_queue<int> pq;

    int workcount = 0;

    for(int i = 1; i <= m; i++){

        while(works[workcount].first == i){
            pq.push(works[workcount]);
            workcount++;
        }

        if(!pq.empty()){
            schedule[i] = pq.front();
            pq.pop();
        }
    }

    int ans = 0;

    rep(i,m){
        ans = ans + schedule[i + 1];
    }

    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:20: error: no matching function for call to 'std::priority_queue<int>::push(__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type&)'
   41 |             pq.push(works[workcount]);
      |             ~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>; value_type = int]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:30: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} to 'const std::priority_queue<int>::value_type&' {aka 'const int&'}
  736 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>; value_type = int]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:25: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} to 'std::priority_queue<int>::value_type&&' {aka 'int&&'}
  744 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
a.cc:46:30: error: 'class std::priority_queue<int>' has no member named 'front'
   46 |             schedule[i] = pq.front();
      |                              ^~~~~
Language: C++

#include <iostream>
#include <queue>

using namespace std;

int main () {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int> > v;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back(make_pair(a, b));
  }

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

  priority_queue<int> pq;

  int index = 0;
  int ans = 0;
  for (int day = 1; day <= M; day++) {
    while (index < v.size() && v[index].first <= day) {
      pq.push(v[index].second);
      index++;
    }

    if (pq.size() > 0) {
      int p = pq.top();
      ans += p;
      pq.pop();
    }
  }
  cout << ans << endl;
}


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

#include<iostream>
#include<vector>
using namespace std;
 
int main(){
	int N,M,sum = 0,count = 0,max = 0,checkFlg = 0;
  	cin >> N >> M;
  	vector<int> a(N,0);
  	vector<int> b(N,0);
  	vector<int> flg(N,1);
   	for(int i = 0;i<N;i++){
    	cin >> a.at(i) >> b.at(i);
    }
  	for(int i = 0;i<M;i++){ //日数
  		for(int j = 0;j<N;j++){ //件数
    		if(a.at(j) + j < M - j){　//間に合うか
        		if(b.at(max) < b.at(j)　&& flg.at(j)){ //一番大きい値を取得できるか
                  	max = j;
                  	flg.at(j) = 0;
                  	checkFlg = 1;
                }
        	}
          	if(checkFlg){
          		sum += b.at(max);
             	checkFlg = 0;
            }
        }
    }
    cout << sum << endl;
  	return 0;
}

Compiler output:
a.cc:16:41: error: extended character 　 is not valid in an identifier
   16 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                                         ^
a.cc:17:47: error: extended character 　 is not valid in an identifier
   17 |                         if(b.at(max) < b.at(j)　&& flg.at(j)){ //一番大きい値を取得できるか
      |                                               ^
a.cc: In function 'int main()':
a.cc:16:41: error: '\U00003000' was not declared in this scope
   16 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                                         ^~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
 
int main(){
	int N,M,sum = 0,count = 0,max = 0,checkFlg = 0;
  	cin >> N >> M;
  	vector<int> a(N,0);
  	vector<int> b(N,0);
  	vector<int> flg(N,1);
   	for(int i = 0;i<N;i++){
    	cin >> a.at(i) >> b.at(b);
    }
  	for(int i = 0;i<M;i++){ //日数
  		for(int j = 0;j<N;j++){ //件数
    		if(a.at(j) + j < M - j){　//間に合うか
        		if(b.at(max) < b.at(j)　&& flg.at(j)){ //一番大きい値を取得できるか
                  	max = j;
                  	flg.at(j) = 0;
                  	checkFlg = 1;
                }
        	}
          	if(checkFlg){
          		sum += b.at(max);
             	checkFlg = 0;
            }
        }
    }
    cout << sum << endl;
  	return 0;
}

Compiler output:
a.cc:16:41: error: extended character 　 is not valid in an identifier
   16 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                                         ^
a.cc:17:47: error: extended character 　 is not valid in an identifier
   17 |                         if(b.at(max) < b.at(j)　&& flg.at(j)){ //一番大きい値を取得できるか
      |                                               ^
a.cc: In function 'int main()':
a.cc:12:31: error: no matching function for call to 'std::vector<int>::at(std::vector<int>&)'
   12 |         cin >> a.at(i) >> b.at(b);
      |                           ~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:20: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1180 |       at(size_type __n)
      |          ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:20: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1199 |       at(size_type __n) const
      |          ~~~~~~~~~~^~~
a.cc:16:41: error: '\U00003000' was not declared in this scope
   16 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                                         ^~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
 
int main(){
	int N,M,sum = 0,count = 0,max = 0,checkFlg = 0;
  	cin >> N >> M;
  	vector<int> a(N,0);
  	vector<int> b(N,0);
  	vector<int> flg(N,1);
   	for(int i = 0;i<N;i++){
    	cin >> a.at(i) >> b.at(b);
    }
  	for(int i = 0;i<M;i++){ //日数
  		for(int j = 0;i<N;j++){ //件数
    		if(a.at(j) + j < M - j){　//間に合うか
        		if(b.at(max) < b.at(j)　&& flg.at(j)){ //一番大きい値を取得できるか
                  	max = j;
                  	flg.at(j) = 0;
                  	checkFlg = 1;
                }
        	}
          	if(checkFlg){
          		sum += b.at(max);
             	checkFlg = 0;
            }
        }
    }
    cout << sum << endl;
  	return 0;
}

Compiler output:
a.cc:16:41: error: extended character 　 is not valid in an identifier
   16 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                                         ^
a.cc:17:47: error: extended character 　 is not valid in an identifier
   17 |                         if(b.at(max) < b.at(j)　&& flg.at(j)){ //一番大きい値を取得できるか
      |                                               ^
a.cc: In function 'int main()':
a.cc:12:31: error: no matching function for call to 'std::vector<int>::at(std::vector<int>&)'
   12 |         cin >> a.at(i) >> b.at(b);
      |                           ~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:20: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1180 |       at(size_type __n)
      |          ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:20: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1199 |       at(size_type __n) const
      |          ~~~~~~~~~~^~~
a.cc:16:41: error: '\U00003000' was not declared in this scope
   16 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                                         ^~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N,M,sum = 0,count = 0,max = 0,checkFlg = 0;
  	cin >> N >> M;
  	vector<int> a(N,0);
  	vector<int> b(N,0);
  	vector<int> flg(N,1);
   	for(int i = 0;i<N;i++){
    	cin << a.at(i) << b.at(b);
    }
  	for(int i = 0;i<M;i++){ //日数
  		for(int j = 0;i<N;j++){ //件数
    		if(a.at(j) + j < M - j){　//間に合うか
        		if(b.at(max) < b.at(j)　&& flg.at(j)){ //一番大きい値を取得できるか
                  	max = j;
                  	flg.at(j) = 0;
                  	checkFlg = 1;
                }
        	}
          	if(checkFlg){
          		sum += b.at(max);
             	checkFlg = 0;
            }
        }
    }
    cout << sum << endl;
  	return 0;
}

Compiler output:
a.cc:15:41: error: extended character 　 is not valid in an identifier
   15 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                                         ^
a.cc:16:47: error: extended character 　 is not valid in an identifier
   16 |                         if(b.at(max) < b.at(j)　&& flg.at(j)){ //一番大きい値を取得できるか
      |                                               ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> a(N,0);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> a(N,0);
      |                ^~~
a.cc:8:16: error: expected primary-expression before 'int'
    8 |         vector<int> b(N,0);
      |                ^~~
a.cc:9:16: error: expected primary-expression before 'int'
    9 |         vector<int> flg(N,1);
      |                ^~~
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin << a.at(i) << b.at(b);
      |                ^
a.cc:11:27: error: 'b' was not declared in this scope
   11 |         cin << a.at(i) << b.at(b);
      |                           ^
a.cc:15:20: error: 'a' was not declared in this scope
   15 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                    ^
a.cc:15:41: error: '\U00003000' was not declared in this scope
   15 |                 if(a.at(j) + j < M - j){　//間に合うか
      |                                         ^~
a.cc:23:32: error: 'b' was not declared in this scope
   23 |                         sum += b.at(max);
      |                                ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,m,ans;
bool cmp(node a,node b){
	if(a.y==b.y)return a.x<b.x;
	return a.y>b.y;
}
struct node{
	int x,y;
}a[100001];
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;++i)scanf("%d%d",&q[i].x,&q[i].y);
	sort(q+1,q+n+1,cmp);
	for(int i=1;i<=n;++i){
		if(q[i].x<=m)ans+=q[i].y;
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc:6:10: error: 'node' was not declared in this scope
    6 | bool cmp(node a,node b){
      |          ^~~~
a.cc:6:17: error: 'node' was not declared in this scope
    6 | bool cmp(node a,node b){
      |                 ^~~~
a.cc:6:23: error: expression list treated as compound expression in initializer [-fpermissive]
    6 | bool cmp(node a,node b){
      |                       ^
a.cc: In function 'int main()':
a.cc:15:44: error: 'q' was not declared in this scope
   15 |         for(int i=1;i<=n;++i)scanf("%d%d",&q[i].x,&q[i].y);
      |                                            ^
a.cc:16:14: error: 'q' was not declared in this scope
   16 |         sort(q+1,q+n+1,cmp);
      |              ^