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

//by OIerC
//Forca Barcelona!
#include<map>
#include<cstdio>
#include<algorithm>
using namespace std;

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	for (; ch < '0' || ch > '9'; ch = getchar()) if (ch == '-') f = -1;
	for (; ch >= '0' && ch <= '9'; ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
	return x * f;
}

map<vector<int>, int> Map;

int main()
{
	vector<int> ch(26);
	
	int n = read();
	
	long long ans = 0;
	for (int i = 1; i <= n; ++i)
	{
		for (int i = 0; i < 26; ++i) ch[i] = 0;
		
		char s[100];
		scanf("%s", s);
		for (int i = 0; i < 10; ++i) ++ch[s[i] - 'a'];
		
		if (Map[ch] > 0) ans += Map[ch];
		++Map[ch];
	}
	
	printf("%lld\n", ans);
	
	return 0;
}


Compiler output:
a.cc:16:5: error: 'vector' was not declared in this scope
   16 | map<vector<int>, int> Map;
      |     ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include<algorithm>
  +++ |+#include <vector>
    6 | using namespace std;
a.cc:16:15: error: wrong number of template arguments (1, should be at least 2)
   16 | map<vector<int>, int> Map;
      |               ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:16:16: error: expected unqualified-id before ',' token
   16 | map<vector<int>, int> Map;
      |                ^
a.cc:16:18: error: expected unqualified-id before 'int'
   16 | map<vector<int>, int> Map;
      |                  ^~~
a.cc: In function 'int main()':
a.cc:20:9: error: 'vector' was not declared in this scope
   20 |         vector<int> ch(26);
      |         ^~~~~~
a.cc:20:9: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:20:16: error: expected primary-expression before 'int'
   20 |         vector<int> ch(26);
      |                ^~~
a.cc:27:46: error: 'ch' was not declared in this scope
   27 |                 for (int i = 0; i < 26; ++i) ch[i] = 0;
      |                                              ^~
a.cc:31:48: error: 'ch' was not declared in this scope
   31 |                 for (int i = 0; i < 10; ++i) ++ch[s[i] - 'a'];
      |                                                ^~
a.cc:33:21: error: 'Map' was not declared in this scope
   33 |                 if (Map[ch] > 0) ans += Map[ch];
      |                     ^~~
a.cc:33:25: error: 'ch' was not declared in this scope
   33 |                 if (Map[ch] > 0) ans += Map[ch];
      |                         ^~
a.cc:34:19: error: 'Map' was not declared in this scope
   34 |                 ++Map[ch];
      |                   ^~~
a.cc:34:23: error: 'ch' was not declared in this scope
   34 |                 ++Map[ch];
      |                       ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n,x) for(int i=n;i<x;i++)

int main() {
	ll n;
	cin >> n;
	vector<string> s(n);
	rep(i, 0, n) cin >> s[i];

	ll ans = 0;
	vector<map<char, int>> mp(n);
	rep(i, 0, n) {
		rep(j, 0, 10) {
			mp[i][s[i][j]]++;
		}
	}
	rep(i, 0, n - 1) {
		rep(j, i + 1, n) {
			if (mp[i] == mp[j]) ans++;
		}
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'll' was not declared in this scope
    6 |         ll n;
      |         ^~
a.cc:7:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin >> n;
      |                ^
      |                yn
a.cc:11:11: error: expected ';' before 'ans'
   11 |         ll ans = 0;
      |           ^~~~
      |           ;
a.cc:20:45: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |                         if (mp[i] == mp[j]) ans++;
      |                                             ^~~
      |                                             abs
a.cc:24:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>
#define For(i,l,r) for (register int i=l; i<=r; i++)
using namespace std;
typedef unsigned long long LL;
typedef signed long long ll;
template <typename T>
inline void read(T &x) {
	char c = getchar(); int w = 1; x = 0;
	while (!isdigit(c))
		(c == '-') && (w = -w), c = getchar();
	while (isdigit(c))
		x = (x << 1) + (x << 3) + (c ^ '0'), c = getchar();
	x *= w;
}
const int dx[8] = {-1, 1, 0, 0, -1, 1, -1, 1},
		  dy[8] = {0, 0, -1, 1, -1, -1, 1, 1};
int w[10000], n, x;
char c[20];
inline void hash() {
	x = 0;
	For(j,1,10)
		x += (c[j]-'a')+(c[j]-'a')*(c[j]-'a');
}
int main() {
	cin >> n;
	memset(w, 0, sizeof(w));
	ll ans = 0;
	For(i,1,n) {
		scanf("%s", c+1);
		hash();
		ans += (w[x]++);
	}
	cout << ans;
	getchar(); getchar();
	return 0;
}

Compiler output:
a.cc: In function 'void hash()':
a.cc:21:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |         For(j,1,10)
      |             ^
a.cc:2:38: note: in definition of macro 'For'
    2 | #define For(i,l,r) for (register int i=l; i<=r; i++)
      |                                      ^
a.cc: In function 'int main()':
a.cc:28:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |         For(i,1,n) {
      |             ^
a.cc:2:38: note: in definition of macro 'For'
    2 | #define For(i,l,r) for (register int i=l; i<=r; i++)
      |                                      ^
a.cc:30:17: error: reference to 'hash' is ambiguous
   30 |                 hash();
      |                 ^~~~
In file included from /usr/include/c++/14/string_view:50,
                 from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:19:13: note:                 'void hash()'
   19 | inline void hash() {
      |             ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
bool is_anagram(string s1, string s2) {
        sort(s1.begin(), s1.end());
        sort(s2.begin(), s2.end());
        for(int i=0;i<s1.length();i++) {
                if(s1[i] != s2[i])
                        return false;
        }
        return true;
}
void solve() {
        int n;
        cin >> n;
        string str[n];
        for(int i=0;i<n;i++)
                cin >> str[i];
        int count = 0;
        for(int i=0;i<n;i++) {
                for(int j=i+1;j<n;j++) {
                        if(is_anagram(str[i], str[j]))
                                count++;
                }
        }
        cout << count << '\n';
        return ;
}
int main() {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        solve();
        return 0;
}
~                                                                                                                                                                                                                  
~

Compiler output:
a.cc:36:1: error: expected class-name before '~' token
   36 | ~
      | ^
Language: C++

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

int nmax = 1e5 + 1;
int c[nmax][nmax];
template <typename T>
T C(T x, T y) {
	if (c[x][y] > 0)return c[x][y];
	if (y == 0 || x == y)return 1;
	return c[x][y] = C(x - 1, y - 1) + C(x - 1, y);
}

signed main() {
	int n;
	cin >> n;
	vector<string> v;
	for (int i = 0; i < n; ++i) {
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		v.push_back(s);
	}
	sort(v.begin(), v.end());
	int cnt = 1;
	int ans = 0;
	for (int i = 1; i < n; ++i) {
		if (v[i - 1] == v[i])++cnt;
		else {
			if (cnt > 1) {
				ans += C(cnt, 2ll);
				cnt = 1;
			}
		}
	}
	if (cnt > 1) {
		ans += C(cnt, 2ll);
		cnt = 1;
	}
	cout << ans << endl;
}

Compiler output:
a.cc:6:13: error: size of array 'c' is not an integral constant-expression
    6 | int c[nmax][nmax];
      |             ^~~~
a.cc:6:7: error: size of array 'c' is not an integral constant-expression
    6 | int c[nmax][nmax];
      |       ^~~~
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
#include <map>
#include <queue>
    
#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)

using namespace std;


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    map<string, ll> mp;
    
    int N;
    cin >> N;
    REP(i, N){
        string S;
        cin >> S;
        sort(S.begin(), S.end());
        mp[S]++;
    }
    ll ans = 0;
    for(auto itr = mp.begin(); itr != mp.end(); itr++){
        //cout << itr->first << ":" << itr->second << endl;
        if(itr->second >= 2){
            ans += (itr->second)*(itr->second - 1)/2;
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'll' was not declared in this scope
   20 |     map<string, ll> mp;
      |                 ^~
a.cc:20:19: error: template argument 2 is invalid
   20 |     map<string, ll> mp;
      |                   ^
a.cc:20:19: error: template argument 4 is invalid
a.cc:28:11: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   28 |         mp[S]++;
      |           ^
a.cc:30:7: error: expected ';' before 'ans'
   30 |     ll ans = 0;
      |       ^~~~
      |       ;
a.cc:31:23: error: request for member 'begin' in 'mp', which is of non-class type 'int'
   31 |     for(auto itr = mp.begin(); itr != mp.end(); itr++){
      |                       ^~~~~
a.cc:31:42: error: request for member 'end' in 'mp', which is of non-class type 'int'
   31 |     for(auto itr = mp.begin(); itr != mp.end(); itr++){
      |                                          ^~~
a.cc:34:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |             ans += (itr->second)*(itr->second - 1)/2;
      |             ^~~
      |             abs
a.cc:37:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include<bits/stdc++.h>
using namespace std;#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  string s;
  map<string,int>m;
  cin>>n;
  int ans=0;
  for(int i=0;i<n;i++)
  {
    cin>>s;
    sort(s.begin(),s.end());
    ans+=m[s];
    m[s]+=1;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:2:21: error: stray '#' in program
    2 | using namespace std;#include<bits/stdc++.h>
      |                     ^
a.cc:2:22: error: 'include' does not name a type
    2 | using namespace std;#include<bits/stdc++.h>
      |                      ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n;
char s[104];
struct dd{
    int cp[34];
    dd(){}
    dd(char *u){
        int o=strlen(u+1);
        memset(cp,0,sizeof(cp));
        for(int i=1;i<=o;i++)cp[u[i]-'a']++;
    }
    operator==(dd B){
        for(int i=0;i<26;i++)if(B.cp[i]!=cp[i])return 0;
        return 1;
    }
}p[100004];
inline bool dex(dd A,dd B){
    for(int i=0;i<26;i++){
        if(A.cp[i]!=B.cp[i])return A.cp[i]<B.cp[i];
    }
    return 1;
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%s",s+1);
        p[i]=dd(s);
    }
    sort(p+1,p+n+1,dex);
    ll ans=0;
    for(int i=1;i<=n;i++){
        int st=i;
        while(st<=n&&p[st]==p[i]){
            st++;
        }
        ll temp=st-i;
        ans+=1LL*temp*(temp-1)/2;
        i=st-1;
    }
    printf("%lld\n",ans);
    return 0;
}


Compiler output:
a.cc:14:5: error: ISO C++ forbids declaration of 'operator==' with no type [-fpermissive]
   14 |     operator==(dd B){
      |     ^~~~~~~~
Language: C++

#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <math.h>
#include <cmath>
#include <string>
#include <time.h>
#include <random>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <string.h>
using namespace std;

//#define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
//#define cin in
//#define cout out
#define pii pair<int,int>
#define ll long long
#define db double
#define ld long double
#define uset unordered_set
#define umap unordered_map

ifstream in("input.txt");
ofstream out("output.txt");

int main()
{
	map<string, int> strings;
	int n;
	cin >> n;
	while (n--) {
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		strings[s]++;
	}

	ll ans = 0;
	for (auto x : strings) {
		ans += ll (x.second) * (x.second - 1) / 2;
	}
	
	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: expected primary-expression before 'long'
   27 | #define ll long long
      |            ^~~~
a.cc:50:24: note: in expansion of macro 'll'
   50 |                 ans += ll (x.second) * (x.second - 1) / 2;
      |                        ^~
Language: C++

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

int main(){
  	cin >> n;
  map<string,int> mp;
  long long ans = 0;
  for(int i = 0; i < n; i++){
  	string s;	cin >> s;
    sort(s.begin(),s.end());
    ans += mp[s];
    mp[s]++;
  }
  cout << ans << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |         cin >> n;
      |                ^
      |                yn
Language: C++

#include <bits/stdc++.h>
#define el "\n"
#define ll long long
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define M 1000000007
#define all(v) v.begin(), v.end()

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    string s;
    unordered_map<string,int> mp;
    for(int i=0;i<n;i++){
         cin>>s;
         sort(all(s));
         mp[s]++;
    }
    ll ans=0,tmp;
    for(auto x:mp){
        tmp=(x.Y)*(x.Y-1);
        tmp/=2;
        ans+=tmp;
    }
    cout<<max(ans,1)<<el;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: no matching function for call to 'max(long long int&, int)'
   32 |     cout<<max(ans,1)<<el;
      |           ~~~^~~~~~~
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:32:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   32 |     cout<<max(ans,1)<<el;
      |           ~~~^~~~~~~
/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:32:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |     cout<<max(ans,1)<<el;
      |           ~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <atcoder/segtree>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<int,int>;
constexpr int INF = 1001001001;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

P op(P a, P b) { return a.second < b.second ? b : a; }
P e() { return make_pair(-1, -1); }
P target;
bool f(P v) { return v.second < target.second; }

int main() {
    int n, m;
    cin >> n >> m;
    vector<P> p(n);
    rep (i, n) {
        int a, b;
        cin >> a >> b;
        p[i] = make_pair(a, b);
    }
    sort(p.begin(), p.end(), greater<P>());
    //for (auto q : p) cout << "(" << q.first << ", " << q.second << ")" << endl;
    vector<int> l(m+1, -1);
    for (int i = n-1; i >= 0; i--) l[p[i].first] = i;
    //rep (i, m+1) cout << "l[" << i << "]:" << l[i] << endl;
    
    segtree<P, op, e> seg(p);
    int pre = -1;
    ll ans = 0;
    rep (i, m+1) {
        int li = l[i];
        //cout << "i:" << i << endl;
        if (li < 0) {
            if (pre < 0) continue;
            else li = pre;
        }
        //cout << "[" << li << "," << n << "] ";
        target = seg.prod(li, n);
        //cout << " target:" << target.second << " ";
        if (target == e()) continue;
        int id = seg.max_right<f>(li);
        //cout << "id:" << id << endl;
        seg.set(id, e());
        ans += target.second;
        pre = li;
    }
    
    cout << ans << endl;
    
    return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/segtree: No such file or directory
    2 | #include <atcoder/segtree>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

// // #include<iostream>
// // #include<vector>
// // #include<algorithm>
// // using namespace std;
// // using ll = long long;
// // #define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

//     // sort(AB.rbegin(), AB.rend());

//     // int now = 0;
//     // int ans = 0;
//     // for(int m = M; m >=0; --m) {
//     //     vector<int> P;
//     //     for(int i = now; i < N; ++i) {
//     //         if(m == AB[i].first) {
//     //             P.push_back(AB[i].second);
//     //         } else {
//     //             ans += *max_element(P.begin(), P.end());
//     //             now = i;
//     //             break;
//     //         }
//     //     }
//     // }
//     // cout << ans << endl;

//     return 0;
// }

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>

using namespace std;

vector <int> v[100001];

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	long long int res = 0;
	int n,m,a,b;
	priority_queue <int> pque;

	cin >> n >> m;

	for(int i=0;i<n;i++)
	{
		cin >> a >> b;
		if(m-a>=0)
		{
			v[m-a].push_back(b);
		}
	}

	for(int i=0;i<m;i++)
	{
		for(auto it : v[i])
		{
			pque.push_back(it);
		}
		if(!pque.empty())
		{
			res += pque.top();
			pque.pop();
		}
	}

	cout << res << '\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:30: error: 'class std::priority_queue<int>' has no member named 'push_back'
   31 |                         pque.push_back(it);
      |                              ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void){
  pair<int,int> a[100000];
  priority_queue<int> pq;
  int n,m;
  cin>>n>>m;
  for(int i=0;i<n;i++){
    cin>>a[i].first>>a[i].second;
  }
  int ans=0,idx=0;
  sort(a.begin(),a.end());
  for(int i=0;i<=m-1;i++){
    while(idx<n && a[idx].first<=m-i){
      pq.push(a[idx].second);
      idx+=1;
    }
    if(pq.empty()){
      continue;
    }
    ans+=pq.top();
    pq.pop();
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'begin' in 'a', which is of non-class type 'std::pair<int, int> [100000]'
   12 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:12:20: error: request for member 'end' in 'a', which is of non-class type 'std::pair<int, int> [100000]'
   12 |   sort(a.begin(),a.end());
      |                    ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
typedef long long ll;

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> work(m, vector<int>);
  ll ans = 0;
  rep(i, n){
    int a, b;
    cin >> a >> b;
    if(a > m)continue;
    a--;
    work[a].push_back(b);
  }
  priority_queue<int> que;
  rep(i, m){
    rep(j,work[i].size()){
      que.push(work[i][j]);
    }
    if(!que.empty()){
      ans += que.top();que.pop();
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:42: error: expected primary-expression before ')' token
   10 |   vector<vector<int>> work(m, vector<int>);
      |                                          ^
Language: C++

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

#define debug(x) cerr << #x << " = " << x << endl;
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define FOR(it, b, e) for (typeof(b) it = (b); it != (e); ++it)
#define MSET(c, v) memset(c, v, sizeof(c))

const int INF = 0x3F3F3F3F; 
const int NEGINF = 0xC0C0C0C0;
const int NULO = -1;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;

inline int cmp(double x, double y = 0) 
{  
  if(fabs(x - y) < EPS)
    return 0;
  return x > y ? 1 : -1;
}

ll exp(ll a, ll b)
{
  ll ans = 1;
  while(b)
  {
    if(b & 1)
      ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}

const int maxn = 2e5 + 10;
ll fat[maxn], inv[maxn];

ll C(int n, int k)
{
  if(n < k) 
    return 0;
  if(n < 0 || k < 0) 
    return 0;
  return (((fat[n] * inv[k]) % mod) * inv[n - k]) % mod;
}

void initFactorials()
{
  fat[0] = 1;
  inv[0] = 1;
  for(int i = 1; i < maxn; i++)
  {
    fat[i] = (i * fat[i-1]) % mod;
    inv[i] = exp(fat[i], mod - 2);
  }
}

vector<int>jobs[maxn];

int main()
{
  ios::sync_with_stdio(0);
  int n,m;
  cin >> n >> m;
  for(int i = 1; i <= n ; i++)
  {
    int a,b;
    cin >> a >> b;  
    job[a].push_back(b);
  }

  ll ans = 0;
  priority_queue<int>pq;
  for(int i = m - 1; i >= 0; i--)
  {
    for(const auto &x : job[m - i])
    {
      pq.push(x);
    }
    if(pq.size())
    {
      ans += pq.top();
      pq.pop();
    }
  }

  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:5: error: 'job' was not declared in this scope; did you mean 'jobs'?
   71 |     job[a].push_back(b);
      |     ^~~
      |     jobs
a.cc:78:25: error: 'job' was not declared in this scope; did you mean 'jobs'?
   78 |     for(const auto &x : job[m - i])
      |                         ^~~
      |                         jobs
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define cvector vector<char>
#define svector vector<string>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,m,ans=0,a,b;cin>>n>>m;
  vector<lvector> jobs(m);
  rep(i,n) {
    cin>>a>>b;
    if(a>m) continue;
    jobs[m-a].emplace_back(b);
  }
  lpque que;
  for(ll i=m-1;i>-1;--i) {
    for(ll job:jobs[i]) que.push(job);
    if(que.size()) {ans+=que.top();que.pop();}
  }
  print(ans);
  return 0;

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

#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1000000000000000LL
using vec = vector<int>;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m; cin>>n>>m;
    vector<vector<int>> p(m+1);
    rep(i,n){
        int a,b;cin>>a>>b;
        if(a>m) continue;
        p[a].push_back(b);
    }

    priority_queue<int> q;
    
    int ans=0;
    for(int i = 1; i <=m; i++){
    
    for(int x : p[i]){
        q.push(x);
    }

        if(!q.empty()){
            ans+=q.top();
            q.pop();
        }
    }

    cout<<ans<<endl;
    return 0;


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

from sys import stdin, stdout
input = stdin.readline
print = stdout.write

import heapq as hq
pq = []
hq.heapify(pq)
n, m = map(int, input().split())
arr = []
for _ in range(n):
    a, b = map(int, input().split())
    arr.append((a, b))
arr = sorted(arr, key=lambda x: x[0])
i = 0
ans = 0
for d in range(1, m + 1):
    while i < n and arr[i][0] <= d:
        hq.heappush(pq, -arr[i][1])
        i += 1
    if pq:
        ans -= hq.heappop(pq)
print(str(ans))


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from sys import stdin, stdout
      | ^~~~
Language: C++

#include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <map>
 
using namespace std;
 
bool cmp(pair<int,int> one, pair<int,int> two){
	return one.second > two.second;
}


vector< pair<int,int> > jobs;

int main(){
	int N, M;
	cin >> N >> M;
	for(int i = 0; i < N; i++){
		int u, v;
		cin >> u >> v;
		jobs.push_back(make_pair(u,v));
	}
	sort(jobs.begin(), jobs.end(), cmp);
		
	int cst = 0;
	for(int j = 0; j < m; j++){
		cst += jobs[j].second;
	}
	cout << cst << endl;

}

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

#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 100005

struct Info{
	bool operator<(const struct Info &arg) const{

		return A < arg.A;
	}
	ll A,B;
};

ll N,M;
Info info[SIZE];


int main(){

	scanf("%lld %lld",&N,&M);

	for(int i = 0; i < N; i++){

		scanf("%lld %lld",&info[i].A,&info[i].B);
	}
	sort(info,info+N);


	ll ans = 0;
	priority_queue<ll> Q;

	if(info[0].A > M){

		printf("0\n");
		return 0;
	}

	priority_queue<ll> Q;
	int index = 0;
	ll ans = 0;

	for(int day = 1; day <= M; day++){

		while(index < N && info[index].A == day){

			Q.push(info[index].B);
			index++;
		}

		ans += Q.top();
	}

	printf("%lld\n",ans);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:28: error: redeclaration of 'std::priority_queue<long long int> Q'
   46 |         priority_queue<ll> Q;
      |                            ^
a.cc:38:28: note: 'std::priority_queue<long long int> Q' previously declared here
   38 |         priority_queue<ll> Q;
      |                            ^
a.cc:48:12: error: redeclaration of 'll ans'
   48 |         ll ans = 0;
      |            ^~~
a.cc:37:12: note: 'll ans' previously declared here
   37 |         ll ans = 0;
      |            ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

template<class T> inline bool chmin(T& a,T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if (a < b) {a = b; return true;} return false;}

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  int N, M; cin >> N >> M;
  vector<vector<int>> jobs(M);
  rep(i, N){
    int a, b; cin >> a >> b;
    if (a > M) continue;
    jobs[m - a].push_back(b);
  }
  priority_queue<int, vector<int>> q;
  ll ans = 0;
  for (imt i = M - 1; i >= 0; --i){
    for (int b: jobs[i]){
      q.push(b);
    }
    if (!q.empty()){
      ans += q.top();
      q.pop();
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:10: error: 'm' was not declared in this scope
   31 |     jobs[m - a].push_back(b);
      |          ^
a.cc:35:8: error: 'imt' was not declared in this scope; did you mean 'int'?
   35 |   for (imt i = M - 1; i >= 0; --i){
      |        ^~~
      |        int
a.cc:35:23: error: 'i' was not declared in this scope
   35 |   for (imt i = M - 1; i >= 0; --i){
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vll = vector<ll> ;
using vs = vector<string> ;
#define all(v) v.begin(),v.end()
 
int main(){
  ll N,M;cin>>N>>M;
  priority_queue<pair<ll,ll>,vector<pair<ll,ll>>> works;
  rep(i,N){
    ll a,b;cin>>a>>b;works.push(make_pair(b,a));
  }
  ll ans=0;
  for(int i=M;i>0;--i){
    while(!works.empty()){
      pair<ll,ll> p = works.top();
      if(p.second<=i){
        ans+=p.first;
        works.pop();
        break;
      }
      works.pop();
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<ll,ll> P;
int main(){
    ll n,m;
    cin >> n >> m;
    priority_queue<P> que;
    for(int i = 0; i < n; i++){
        ll a,b;
        cin >> a >> b;
        que.push({a,b});
    }
    ll sum = 0;
    for(int i = 0; i < n && !que.empty();){
        P p = que.top();
        que.pop();
        if(i + p.second <= m){
        sum += p.second;
        i++;
    }
    cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<ll,ll> P;
int main(){
    ll n,m;
    cin >> n >> m;
    priority_queue<P> que;
    for(int i = 0; i < n; i++){
        ll a,b;
        cin >> a >> b;
        que.push({a,b});
    }
    ll sum = 0;
    for(int i = 0; i < n; i++){
        P p = que.top();
        que.pop();
        if(i + p.first <= m)
        sum += p.second;
        else
        break;
    }
    co

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'co' was not declared in this scope; did you mean 'cos'?
   23 |     co
      |     ^~
      |     cos
a.cc:23:7: error: expected '}' at end of input
   23 |     co
      |       ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: Java

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main 
{
	static class C implements Comparator<Job>
	{

		@Override
		public int compare(Job o1, Job o2) 
		{
			return o1.del - o2.del;
		}
	}
	
	static class Job
	{
		long rew;
		long del;
		
		public Job(int r, int d)
		{
			rew = r;
			del = d;
		}
	}

	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		Job[] job = new Job[n];
		
		for(int i = 0; i < n; i++)
		{
			int a = sc.nextInt();
			int b = sc.nextInt();
			job[i] = new Job(b,a);
		}
		C c = new C();
		Arrays.sort(job,c);
		int cur = 0;
		PriorityQueue<Long> pq = new PriorityQueue<>(Collections.reverseOrder());
		long sum = 0;
		for(int x = m; x >= 1; x--)
		{
			int accdel = m-x+1;
//			System.out.println("Day " + x + ", accdel " + accdel);
//			if(cur<n)System.out.println("Nextacc " + job[cur].del);
			while(cur < n && job[cur].del <= accdel)
			{
//				if(cur<n)System.out.println("Add new job");
				pq.add(job[cur].rew);
				cur++;
			}
			if(!pq.isEmpty())
			{
				sum += pq.poll();
//				System.out.println("Take " + sum);
			}
		}
		System.out.println(sum);

	}

}


Compiler output:
Main.java:15: error: incompatible types: possible lossy conversion from long to int
			return o1.del - o2.del;
			              ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int n,m;
  cin >> n >> m;
  vector<vector<int>> k(m,vector<int>(1,0));
  int ans=0;
  priority_queue<int, vector<int>, less<int>> q;
  rep(i,n){
    int a,b;
    cin >> a >> b;
    k[a-1].push_back(b);
  }
  rep(i,m){
    while(k[i].size()>=1){
      int w=k[i].pop_back();
      q.push(w);
    }
    if(q.size()>=1){
      ans+=q.top();
      q.pop();
    }
  }
  cout << ans << endl;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: void value not ignored as it ought to be
   17 |       int w=k[i].pop_back();
      |             ~~~~~~~~~~~~~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int n,m;
  cin >> n >> m;
  vector<vector<int>> k(m,vector<int>(1,0));
  int ans=0;
  priority_queue<int, vector<int>, less<int>> q;
  rep(i,n){
    int a,b;
    cin >> a >> b;
    k[a-1].push_back(b);
  }
  rep(i,m){
    while(k[i].size()>=1){
      int w=k[i].pop_back();
      q.push(w);
    }
    ans+=q.top();
    q.pop();
  }
  cout << ans << endl;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: void value not ignored as it ought to be
   17 |       int w=k[i].pop_back();
      |             ~~~~~~~~~~~~~^~
Language: Java

import java.util.*;

public class SummerVacation {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numberOfJobs = scanner.nextInt();
        int remainingDays = scanner.nextInt();
        List<JobInfo> pairs = new ArrayList<>();
        for (int i = 0; i < numberOfJobs; i++) {
            int days = scanner.nextInt();
            int reward = scanner.nextInt();
            if (days <= remainingDays)
                pairs.add(new JobInfo(days, reward));
        }
        int size = 1;
        long totalReward = 0;
        PriorityQueue<JobInfo> priorityQueue = new PriorityQueue<>(Comparator.comparingInt(a -> -a.reward));
        while (size <= remainingDays) {
            for (int i = 0; i < pairs.size(); i++) {
                JobInfo info = pairs.get(i);
                if (info.days <= size) {
                    if (!priorityQueue.contains(info)) {
                        priorityQueue.add(info);
                        pairs.remove(info);
                    }
                }
            }
            if (!priorityQueue.isEmpty())
                totalReward += priorityQueue.poll().reward;
            size++;
        }
        System.out.println(totalReward);
    }

    private static class JobInfo {
        int days;
        int reward;

        public JobInfo(int days, int reward) {
            this.days = days;
            this.reward = reward;
        }
    }
}


Compiler output:
Main.java:3: error: class SummerVacation is public, should be declared in a file named SummerVacation.java
public class SummerVacation {
       ^
1 error
Language: Java

import java.util.*;

public class SummerVacation {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numberOfJobs = scanner.nextInt();
        int remainingDays = scanner.nextInt();
        List<JobInfo> pairs = new ArrayList<>();
        for (int i = 0; i < numberOfJobs; i++) {
            int days = scanner.nextInt();
            int reward = scanner.nextInt();
            if (days <= remainingDays)
                pairs.add(new JobInfo(days, reward));
        }
        int size = 1;
        int totalReward = 0;
        PriorityQueue<JobInfo> priorityQueue = new PriorityQueue<>(Comparator.comparingInt(a -> -a.reward));
        while (size <= remainingDays) {

            for (int i = 0; i < pairs.size(); i++) {
                JobInfo info = pairs.get(i);
                if (info.days <= size) {
                    if (!priorityQueue.contains(info)) {
                        priorityQueue.add(info);
                        pairs.remove(info);
                    }
                }
            }
            if (!priorityQueue.isEmpty())
                totalReward += priorityQueue.poll().reward;
            size++;
        }
        System.out.println(totalReward);
    }

    private static class JobInfo {
        int days;
        int reward;

        public JobInfo(int days, int reward) {
            this.days = days;
            this.reward = reward;
        }
    }
}


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

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;

int main() {
  int n, m, t = 0; ulint s = 0;
  cin >> n >> m;
  vector<pii> v(n);
  rep(i, n) cin >> v[i].fi >> v[i].se;
  sort(v.begin(), v.end());
  priority_queue<int> p;
  rep(i, m){
    if(t < n){
      while(v[t].fi < i+2){
        ++t;
        p.push(v[t].se);
    }
    s += p.top();
    p.pop();
  }
  cout << s << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:2: error: expected '}' at end of input
   48 | }
      |  ^
a.cc:30:12: note: to match this '{'
   30 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
using namespace std;

int main() {
    int n, m; cin >> n >> m;
    vector<vector<int>> data(100005, vector<int>());
    rep(i, n) {
        int a, b; cin >> a >> b;
        data[a].push_back(b);
    }

    ll ans = 0;
    priority_queue<int> q;
    for (int i = 1; i <= m; ++i) {
        for (auto e: data[i]) q.push(e);
        if (!q.empty()) {
            int tmp = q.top();
            ans += tmp;
            q.pop();
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'll' was not declared in this scope
   13 |     ll ans = 0;
      |     ^~
a.cc:19:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |             ans += tmp;
      |             ^~~
      |             abs
a.cc:23:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C

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

int main() {
	int n, m;
	cin >> n >> m;
	vector<pair<int, int>> w(n);
	for (int i = 0; i < n; i++)
		cin >> w[i].first >> w[i].second;
	sort(w.begin(), w.end());
	priority_queue<int> pay;
	int ans = 0;
	for (int a = 1; a <= m; a++) {
		while (!w.empty() && w[0].first <= a) {
			pay.push(w[0].second);
			w.erase(w.begin());
		}
		if (!pay.empty()) {
			ans += pay.top();
			pay.pop();
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define SZ(v) ((int)(v).size())
#define zero(v) memset(v,0,sizeof(v))
#define rep(i,n) for(int i=0;i<(n);i++)
#define foreach(it,c) for(__typeof(c.begin()) it=c.begin();it!=c.end();it++)
#define all(v) (v).begin(),(v).end()
template<typename T>inline bool chkmin(T &a,const T &b){return a>b?a=b,1:0;}
template<typename T>inline bool chkmax(T &a,const T &b){return a<b?a=b,1:0;}
typedef long long ll;
typedef unsigned uint;
const int INF=1e8;
const int oo=0x3f3f3f3f;
const double eps=1e-10;
int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)
{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}
while((uint)((c=getchar())-'0')<10);return x;}
int n,m;
const int Maxn=1e5+5;
pair<ll,ll>buf[Maxn];
int suff[Maxn];
//bool vis[Maxn];
int main(){
	cin>>n>>m;
	rep(i,n){
		cin>>buf[i].second>>buf[i].first;
	}
	sort(buf,buf+n);
//	cout<<endl;
//	rep(i,n)cout<<buf[i].second<<' '<<buf[i].first<<endl;
	
	for(int i=n-1;i>=0;i--){
		suff[i]=suff[i+1];
		if(buf[i].second==1)suff[i]++;
	}
//	cout<<endl;
//	rep(i,n)cout<<suff[i]<<' ';cout<<endl;
	ll sum=0,ans=0;
	for(int i=n-1;i>=0;i--){
		int A=buf[i].second,B=buf[i].first;
		int delta=sum+A-n+i+1;
		if(suff[i])delta+=suff[i]-1;
		if(delta<=m){
			sum+=A;
			ans+=B;
			vis[i]=true;
		}
	}
//	rep(i,n)cout<<vis[i]<<' ';cout<<endl;
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:25: error: 'vis' was not declared in this scope
   46 |                         vis[i]=true;
      |                         ^~~
Language: Java


import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {

    static Map<Integer, List<Integer>> workMap = new HashMap<>();

    /**
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = 0;
        int m = 0;

        int inputLineIdx = 1;
        while (true) {
            String inputText = scanner.nextLine();
            String[] inputTextArr = inputText.split(" ");

            if (inputLineIdx == 1) {
                n = Integer.parseInt(inputTextArr[0]);
                m = Integer.parseInt(inputTextArr[1]);
            } else {
                Integer day = Integer.valueOf(inputTextArr[0]);
                Integer pay = Integer.valueOf(inputTextArr[1]);

                List<Integer> payList = workMap.get(day);
                if (payList == null) {
                    payList = new ArrayList<>();
                }
                payList.add(pay);
                workMap.put(day, payList);
            }

            if (inputLineIdx == n + 1) {
                break;
            }

            inputLineIdx++;
        }
        scanner.close();


        List<Integer> pq = new ArrayList<>();

        int result = 0;
        for (int dayIdx = 1; dayIdx <= m; dayIdx++) {
            List<Integer> payList = workMap.get(dayIdx);
            if (payList != null && payList.size() > 0) {
                pq.addAll(payList);
            }

            if (pq != null && pq.size() > 0) {
                Integer maxValue = Collections.max(pq);
                result = result + maxValue;

                pq.remove(maxValue);
            }
        }

        System.out.println(result);
    }


Compiler output:
Main.java:68: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
const int INF= 1e9+5;
typedef long long ll;
int main(){
  int n,m;
  cin>>n>>m;
  vector<int>a(n);
  vector<int>b(n);
  vector<ll>ans(100001);
  priority_queue<int>pq;
  for(int i=0;i<n;i++)cin>>a[i]>>b[i];
  vector<vector<int>>data(100001);
  for(int i=0;i<n;i++){
    data[a[i]].push_back(b[i]);
  }
  ll sum=0;
  ans[0]=0;
  for(int i=1;i<=m;i++){
    if(data[i].size()=0)continue;
    for(int j=0;j<data[i].size();j++){
      pq.push(data[i][j]);
    }
    if(pq.size()>0){
      sum+=pq.top();
      pq.pop();
    }
    ans[i]=sum;
  }
  cout<<ans[m]<<endl;
}
      
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: lvalue required as left operand of assignment
   21 |     if(data[i].size()=0)continue;
      |        ~~~~~~~~~~~~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    const int M = 1e5
    int n,m; cin >> n >> m;
    vector<vector<int>> ab(M+1);
    REP(i,n) {
        int a,b;
        cin >> a >> b;
        ab[a].push_back(b);
    }
    
    priority_queue<pii> pq;
    ll ans = 0;
    FOR(i,1,m+1) {
        for(auto x:ab[i]) pq.push({x,i});
        if (!pq.empty()) {
            ans += pq.top().first;
            pq.pop();
        }
    }
    
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: expected ',' or ';' before 'int'
   20 |     int n,m; cin >> n >> m;
      |     ^~~
a.cc:20:21: error: 'n' was not declared in this scope
   20 |     int n,m; cin >> n >> m;
      |                     ^
a.cc:20:26: error: 'm' was not declared in this scope
   20 |     int n,m; cin >> n >> m;
      |                          ^