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

#include <iostream>
#include <queue>
#include <vector>
    
using namespace std;
    
int N, M, L;
    
struct edge {
    int to, distance, enemy;
};
    
struct P {
    int from, money, enemy;
    
    bool operator >(const P& p) const {
        return enemy > p.enemy;
    }
};
 
struct pair {
    int money, enemy;
}
    
int main() {
    while (cin >> N >> M >> L, N|M|L) {
        vector<vector<edge> > E(N);
        int a, b, d, e;
        for (int i = 0; i < M; i++) {
            cin >> a >> b >> d >> e;
            E[a-1].push_back({b, d, e});
            E[b-1].push_back({a, d, e});
        }
    
        priority_queue<P, vector<P>, greater<P>> q;
        city arr[N];
        for(int i = 0; i < N; i++) {
            arr[i].money = 0;
        }   
        q.push((P){0, L, 0});
        while(!q.empty()) {
            P p = q.top(); q.pop();
            // goal
            if (p.from == N-1) {
                cout << p.enemy << endl;
                break;
            }
            if (p.money >= arr[p.from].money) {
                arr[p.from].money = p.money;
                arr[p.from].enemy = p.enemy;
            } else if (p.enemy <= arr[p.from].enemy) {
                continue;
            }
  
            for (int i = 0; i < E[p.from].size() ; i++) {
                edge e = E[p.from][i];
                q.push((P){e.to-1, p.money, p.enemy+e.enemy});
                if (p.money-e.distance >= 0) {
                    q.push((P){e.to-1, p.money-e.distance, p.enemy});
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc:23:2: error: expected ';' after struct definition
   23 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:36:9: error: 'city' was not declared in this scope
   36 |         city arr[N];
      |         ^~~~
a.cc:38:13: error: 'arr' was not declared in this scope
   38 |             arr[i].money = 0;
      |             ^~~
a.cc:48:28: error: 'arr' was not declared in this scope
   48 |             if (p.money >= arr[p.from].money) {
      |                            ^~~
Language: C++

#include <iostream>
#include <queue>
#include <vector>
     
using namespace std;
     
int N, M, L;
     
struct edge {
    int to, distance, enemy;
};
     
struct P {
    int from, money, enemy;
     
    bool operator >(const P& p) const {
        return enemy > p.enemy;
    }
};
  
struct pair {
    int money, enemy;
};
     
int main() {
    while (cin >> N >> M >> L, N|M|L) {
        vector<vector<edge> > E(N);
        int a, b, d, e;
        for (int i = 0; i < M; i++) {
            cin >> a >> b >> d >> e;
            E[a-1].push_back({b, d, e});
            E[b-1].push_back({a, d, e});
        }
     
        priority_queue<P, vector<P>, greater<P>> q;
        city arr[N];
        for(int i = 0; i < N; i++) {
            arr[i].money = 0;
        }   
        q.push((P){0, L, 0});
        while(!q.empty()) {
            P p = q.top(); q.pop();
            // goal
            if (p.from == N-1) {
                cout << p.enemy << endl;
                break;
            }
            if (p.money >= arr[p.from].money) {
                arr[p.from].money = p.money;
                arr[p.from].enemy = p.enemy;
            } else if (p.enemy <= arr[p.from].enemy) {
                continue;
            }
   
            for (int i = 0; i < E[p.from].size() ; i++) {
                edge e = E[p.from][i];
                q.push((P){e.to-1, p.money, p.enemy+e.enemy});
                if (p.money-e.distance >= 0) {
                    q.push((P){e.to-1, p.money-e.distance, p.enemy});
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: 'city' was not declared in this scope
   36 |         city arr[N];
      |         ^~~~
a.cc:38:13: error: 'arr' was not declared in this scope
   38 |             arr[i].money = 0;
      |             ^~~
a.cc:48:28: error: 'arr' was not declared in this scope
   48 |             if (p.money >= arr[p.from].money) {
      |                            ^~~
Language: C++

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

using namespace std;

typedef struct {
	int to;
	int D;
	int E;
} Edge;

class State {
public:

	int now;
	int money;
	int damaged;

	State(int now, int money, int damaged) {
		this->now = now;
		this->money = money;
		this->damaged = damaged;
	}

};

const int INF  = 999999;

vector<Edge> G[101];

int d[101][101];

int N, M, L;

int toV(int n, int l) {
	return n * L + l;
}

int main() {
	while (cin >> N >> M >> L, N + M + L != 0) {
		queue<State> q;
		for (int i = 0; i < 101; i++) {
			G[i].clear();
			for (int j = 0; j < 101; j++) {
				d[i][j] = INF;
			}
		}
		for (int i = 0; i < M; i++) {
			int A, B, D, E;
			cin >> A >> B >> D >> E;
			Edge e { B, D, E };
			Edge e2 { A, D, E };
			G[A].push_back(e);
			G[B].push_back(e2);
		}
		q.push(State(1, L, 0));
		while (!q.empty()){
			State s = q.front();
			q.pop();
			if (s.damaged > d[s.now][s.money]) continue;
			d[s.now][s.money] = s.damaged;
			
			for each (Edge e in G[s.now])
			{
				q.push(State(e.to, s.money, s.damaged + e.E));
				if (s.money - e.D >= 0) {
					q.push(State(e.to, s.money - e.D, s.damaged));
				}
			}
		}
		int m = INF;
		for (int i = 0; i <= L; i++) {
			m = min(m, d[N][i]);
		}
		cout << m << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:29: error: expected '(' before 'each'
   65 |                         for each (Edge e in G[s.now])
      |                             ^~~~
      |                             (
a.cc:65:40: error: expected primary-expression before 'e'
   65 |                         for each (Edge e in G[s.now])
      |                                        ^
a.cc:65:29: error: 'each' was not declared in this scope
   65 |                         for each (Edge e in G[s.now])
      |                             ^~~~
a.cc:72:17: error: expected primary-expression before '}' token
   72 |                 }
      |                 ^
a.cc:71:26: error: expected ';' before '}' token
   71 |                         }
      |                          ^
      |                          ;
   72 |                 }
      |                 ~         
a.cc:72:17: error: expected primary-expression before '}' token
   72 |                 }
      |                 ^
a.cc:71:26: error: expected ')' before '}' token
   71 |                         }
      |                          ^
      |                          )
   72 |                 }
      |                 ~         
a.cc:65:29: note: to match this '('
   65 |                         for each (Edge e in G[s.now])
      |                             ^~~~
a.cc:72:17: error: expected primary-expression before '}' token
   72 |                 }
      |                 ^
Language: C++

#include<iostream>
#include<fstream>
#include<algorithm>
#include<vector>
#include<queue>
#include<array>

#define fin cin

using std::cout;
using std::endl;

class Input{
public:
	int a;
	int b;
	int d;
	int e;
	Input(int _a, int _b, int _d, int _e){
		a = _a;
		b = _b;
		d = _d;
		e = _e;
	}
	operator < (Input& other)
	{
		return this->a < other.a;
	}
	operator > (Input& other)
	{
		return this->a > other.a;
	}

};

const int initnum = 10000000;

std::vector<Input> in_v{};
std::array<std::array<int, 100>, 100> cost;

int main()
{
	//std::ifstream fin("in.txt");
	//cost[0].fill(0);
	//for(int i = 1; i < 100; i++)cost[i].fill(10000000);

	while(true)
	{
		cost[0].fill(0);
		//cost[1].fill(0);
		for(int i = 1; i < 100; i++)cost[i].fill(initnum);
	
		int n, m, l;
		fin >> n >> m >> l;
		if((n | m | l) == 0)break;
		//cout << n << " " << m << " " << l << endl;
	
		for(int i = 0; i < m; i++)
		{
			int a, b, d, e;
			fin >> a >> b >> d >> e;
			in_v.push_back(Input(a-1, b-1, d, e));
			in_v.push_back(Input(b-1, a-1, d, e));
		}
		sort(in_v.begin(), in_v.end());

		std::queue<Input> in_q;
		for(auto in : in_v)in_q.push(in);

		in_v.clear();
		in_v.shrink_to_fit();

		while(!in_q.empty())
		{
			Input tmp = in_q.front();
			in_q.pop();

			for(int _cost = 0; _cost <= l; _cost++)
			{

				if(cost[tmp.a][_cost] == initnum)
				{
					in_q.push(tmp);
					break;
				}

				cost[tmp.b][_cost] = std::min(
					cost[tmp.b][_cost],
					std::min(
						(_cost + tmp.d <= l ? (cost[tmp.a][_cost + tmp.d]) : initnum / 10),
						cost[tmp.a][_cost] + tmp.e
				)
				);

			}
			for(int i = 0; i <= l + 2; i++){
			//	cout << cost[n - 1][i] << " ";
			}
			//cout << endl;
		
		}
		int min_cost = 10000000;

		for(int i = 0; i <= l; i++){
			if(cost[n - 1][i] < min_cost)min_cost = cost[n - 1][i];
		//	cout << cost[n - 1][i] << " ";
		}
		cout << min_cost << endl;
	}

	return 0;
}

Compiler output:
a.cc:25:9: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
   25 |         operator < (Input& other)
      |         ^~~~~~~~
a.cc:29:9: error: ISO C++ forbids declaration of 'operator>' with no type [-fpermissive]
   29 |         operator > (Input& other)
      |         ^~~~~~~~
a.cc: In function 'int main()':
a.cc:8:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 | #define fin cin
      |             ^~~
a.cc:54:17: note: in expansion of macro 'fin'
   54 |                 fin >> n >> m >> l;
      |                 ^~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include<iostream>
#include<fstream>
#include<algorithm>
#include<vector>
#include<queue>
#include<array>

#define fin cin

using std::cin;
using std::cout;
using std::endl;

class Input{
public:
	int a;
	int b;
	int d;
	int e;
	Input(int _a, int _b, int _d, int _e){
		a = _a;
		b = _b;
		d = _d;
		e = _e;
	}
	operator < (Input& other)
	{
		return this->a < other.a;
	}
	operator > (Input& other)
	{
		return this->a > other.a;
	}

};

const int initnum = 10000000;

std::vector<Input> in_v{};
std::array<std::array<int, 100>, 100> cost;

int main()
{
	//std::ifstream fin("in.txt");
	//cost[0].fill(0);
	//for(int i = 1; i < 100; i++)cost[i].fill(10000000);

	while(true)
	{
		cost[0].fill(0);
		//cost[1].fill(0);
		for(int i = 1; i < 100; i++)cost[i].fill(initnum);
	
		int n, m, l;
		fin >> n >> m >> l;
		if((n | m | l) == 0)break;
		//cout << n << " " << m << " " << l << endl;
	
		for(int i = 0; i < m; i++)
		{
			int a, b, d, e;
			fin >> a >> b >> d >> e;
			in_v.push_back(Input(a-1, b-1, d, e));
			in_v.push_back(Input(b-1, a-1, d, e));
		}
		sort(in_v.begin(), in_v.end());

		std::queue<Input> in_q;
		for(auto in : in_v)in_q.push(in);

		in_v.clear();
		in_v.shrink_to_fit();

		while(!in_q.empty())
		{
			Input tmp = in_q.front();
			in_q.pop();

			for(int _cost = 0; _cost <= l; _cost++)
			{

				if(cost[tmp.a][_cost] == initnum)
				{
					in_q.push(tmp);
					break;
				}

				cost[tmp.b][_cost] = std::min(
					cost[tmp.b][_cost],
					std::min(
						(_cost + tmp.d <= l ? (cost[tmp.a][_cost + tmp.d]) : initnum / 10),
						cost[tmp.a][_cost] + tmp.e
				)
				);

			}
			for(int i = 0; i <= l + 2; i++){
			//	cout << cost[n - 1][i] << " ";
			}
			//cout << endl;
		
		}
		int min_cost = 10000000;

		for(int i = 0; i <= l; i++){
			if(cost[n - 1][i] < min_cost)min_cost = cost[n - 1][i];
		//	cout << cost[n - 1][i] << " ";
		}
		cout << min_cost << endl;
	}

	return 0;
}

Compiler output:
a.cc:26:9: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
   26 |         operator < (Input& other)
      |         ^~~~~~~~
a.cc:30:9: error: ISO C++ forbids declaration of 'operator>' with no type [-fpermissive]
   30 |         operator > (Input& other)
      |         ^~~~~~~~
Language: C++

#include<iostream>
#include<fstream>
#include<algorithm>
#include<vector>
#include<queue>
#include<array>

#define fin cin

using std::cin;
using std::cout;
using std::endl;

class Input{
public:
	int a;
	int b;
	int d;
	int e;
	Input(int _a, int _b, int _d, int _e){
		a = _a;
		b = _b;
		d = _d;
		e = _e;
	}
	operator < (Input& other){
		return (this->a < other.a);
	}
	operator > (Input& other){
		return (this->a > other.a);
	}

};

const int initnum = 10000000;

std::vector<Input> in_v{};
std::array<std::array<int, 100>, 100> cost;

int main()
{
	//std::ifstream fin("in.txt");
	//cost[0].fill(0);
	//for(int i = 1; i < 100; i++)cost[i].fill(10000000);

	while(true)
	{
		cost[0].fill(0);
		//cost[1].fill(0);
		for(int i = 1; i < 100; i++)cost[i].fill(initnum);
	
		int n, m, l;
		fin >> n >> m >> l;
		if((n | m | l) == 0)break;
		//cout << n << " " << m << " " << l << endl;
	
		for(int i = 0; i < m; i++)
		{
			int a, b, d, e;
			fin >> a >> b >> d >> e;
			in_v.push_back(Input(a-1, b-1, d, e));
			in_v.push_back(Input(b-1, a-1, d, e));
		}
		sort(in_v.begin(), in_v.end());

		std::queue<Input> in_q;
		for(auto in : in_v)in_q.push(in);

		in_v.clear();
		in_v.shrink_to_fit();

		while(!in_q.empty())
		{
			Input tmp = in_q.front();
			in_q.pop();

			for(int _cost = 0; _cost <= l; _cost++)
			{

				if(cost[tmp.a][_cost] == initnum)
				{
					in_q.push(tmp);
					break;
				}

				cost[tmp.b][_cost] = std::min(
					cost[tmp.b][_cost],
					std::min(
						(_cost + tmp.d <= l ? (cost[tmp.a][_cost + tmp.d]) : initnum / 10),
						cost[tmp.a][_cost] + tmp.e
				)
				);

			}
			for(int i = 0; i <= l + 2; i++){
			//	cout << cost[n - 1][i] << " ";
			}
			//cout << endl;
		
		}
		int min_cost = 10000000;

		for(int i = 0; i <= l; i++){
			if(cost[n - 1][i] < min_cost)min_cost = cost[n - 1][i];
		//	cout << cost[n - 1][i] << " ";
		}
		cout << min_cost << endl;
	}

	return 0;
}

Compiler output:
a.cc:26:9: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
   26 |         operator < (Input& other){
      |         ^~~~~~~~
a.cc:29:9: error: ISO C++ forbids declaration of 'operator>' with no type [-fpermissive]
   29 |         operator > (Input& other){
      |         ^~~~~~~~
Language: C++

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

struct road
{
	int to, cost, k;//???????????????????????????
};
vector<road>rinsetu[100];
int mincost[100][101];//i??°??????j????????£?????????
struct A
{
	int x, y, z;//??´????????????????????????
};
bool operator <(A b, A c) {
	if (b.z != c.z)return b.z > c.z;
	return b.x * 1000 + b.y > c.x * 1000 + c.y;
}
signed main() {
	int a, b, c;
	while (scanf("%d%d%d", &a, &b, &c), a || b || c) {
		for (int d = 0; d < a; d++) {
			rinsetu[d].clear();
		}
		for (int d = 0; d < b; d++) {
			int e, f, g, h; scanf("%d%d%d%d", &e, &f, &g, &h);
			e--; f--;
			rinsetu[e].push_back({ f,g,h });
			rinsetu[f].push_back({ e,g,h });
		}
		memset(mincost, 0x3f, sizeof(mincost));
		mincost[0][c] = 0;
		priority_queue<A>Q;
		Q.push({0,c,0});
		while (Q.size()) {
			A d = Q.top(); Q.pop();
			cout << d.x << " " << d.y << " " << d.z << endl;
			if (d.z > mincost[d.x][d.y])continue;
			for (road i : rinsetu[d.x]) {
				//?????????????????????
				if (mincost[i.to][d.y] > d.z + i.k) {
					mincost[i.to][d.y] = d.z + i.k;
					Q.push({i.to,d.y,d.z + i.k });
				}
				//???????????????
				if (d.y >= i.cost) {
					if (mincost[i.to][d.y - i.cost] > d.z) {
						mincost[i.to][d.y - i.cost] = d.z;
						Q.push({ i.to, d.y - i.cost, d.z });
					}
				}
			}
		}
		int MIN = 1 << 29;
		for (int i = 0; i <= c; i++) {
			MIN = min(MIN, mincost[a-1][i]);
		}
		printf("%d\n", MIN);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:17: error: 'memset' was not declared in this scope
   34 |                 memset(mincost, 0x3f, sizeof(mincost));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<queue>
  +++ |+#include <cstring>
    5 | #include<vector>
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, m, l;
int V;

int vv(int v, int mon)
{
    return v * (l + 1) + mon;
}

vector<int> dijkstra(int s, vector<vector<pair<int, int>>> &edge)
{
    const int INF = 1e9;
    vector<int> d(V, INF);
    d[s] = 0;
    priority_queue<pair<int, int>> que; //cost v
    que.push({0, s});
    while (!que.empty())
    {
        auto st = que.top();
        que.pop();
        int v = st.second;
        int cost = st.first;
        if (d[v] < cost)
            continue;
        for (int i = 0; i < edge[v].size(); i++)
        {
            int to = edge[v][i].second;
            if (cost + edge[v][i].first < d[to])
            {
                d[to] = cost + edge[v][i].first;
                que.push({d[to], to});
            }
        }
    }
    return d;
}

int main()
{
    while (true)
    {
        cin >> n >> m >> l;
        if (n == 0)
            break;
        V = n * (l + 1);
        vector<vector<pair<int, int>>> edge(V); //cost,to
        for (int i = 0; i < m; i++)
        {
            int a, b, d, e;
            cin >> a >> b >> d >> e;
            a--, b--;
            for (int j = 0; j <= l; j++)
            {
                edge[vv(a, j)].push_back({e, vv(b, j)});
                edge[vv(b, j)].push_back({e, vv(a, j)});
                if (j - d >= 0)
                {
                    edge[vv(a, j)].push_back({0, vv(b, j - d)});
                    edge[vv(b, j)].push_back({0, vv(a, j - d)});
                }
            }
        }
        vector<int> d = dijkstra(vv(0, l), edge);
        int res = 1e9;

        for (int i = 0; i <= l; i++)
        {
            int val=d[vv(n-1,i)];
            
            res = min(res,val);
        }

        cout << res << endl;
    }
    return 0;
}

    return 0;
}

Compiler output:
a.cc:79:5: error: expected unqualified-id before 'return'
   79 |     return 0;
      |     ^~~~~~
a.cc:80:1: error: expected declaration before '}' token
   80 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, m, l;
int V;

int vv(int v, int mon)
{
    return v * (l + 1) + mon;
}

vector<int> dijkstra(int s, vector<vector<pair<int, int>>> &edge)
{
    const int INF = 1e9;
    vector<int> d(V, INF);
    d[s] = 0;
    priority_queue<pair<int, int>> que; //cost v
    que.push(make_pair(0, s));
    while (!que.empty())
    {
        auto st = que.top();
        que.pop();
        int v = st.second;
        int cost = st.first;
        if (d[v] < cost)
            continue;
        for (int i = 0; i < edge[v].size(); i++)
        {
            int to = edge[v][i].second;
            if (cost + edge[v][i].first < d[to])
            {
                d[to] = cost + edge[v][i].first;
                que.push(make_paird[to], to));
            }
        }
    }
    return d;
}

int main()
{
    while (true)
    {
        cin >> n >> m >> l;
        if (n == 0)
            break;
        V = n * (l + 1);
        vector<vector<pair<int, int>>> edge(V); //cost,to
        for (int i = 0; i < m; i++)
        {
            int a, b, d, e;
            cin >> a >> b >> d >> e;
            a--, b--;
            for (int j = 0; j <= l; j++)
            {
                edge[vv(a, j)].push_back(make_pair(e, vv(b, j)));
                edge[vv(b, j)].push_back(make_piar(e, vv(a, j)));
                if (j - d >= 0)
                {
                    edge[vv(a, j)].push_back(make_pair(0, vv(b, j - d)));
                    edge[vv(b, j)].push_back(make_pair(0, vv(a, j - d)));
                }
            }
        }
        vector<int> d = dijkstra(vv(0, l), edge);
        int res = 1e9;

        for (int i = 0; i <= l; i++)
        {
            int val=d[vv(n-1,i)];
            
            res = min(res,val);
        }

        cout << res << endl;
    }
    return 0;
}

    return 0;
}

Compiler output:
a.cc: In function 'std::vector<int> dijkstra(int, std::vector<std::vector<std::pair<int, int> > >&)':
a.cc:32:26: error: 'make_paird' was not declared in this scope
   32 |                 que.push(make_paird[to], to));
      |                          ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:56:42: error: 'make_piar' was not declared in this scope
   56 |                 edge[vv(b, j)].push_back(make_piar(e, vv(a, j)));
      |                                          ^~~~~~~~~
a.cc: At global scope:
a.cc:79:5: error: expected unqualified-id before 'return'
   79 |     return 0;
      |     ^~~~~~
a.cc:80:1: error: expected declaration before '}' token
   80 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, m, l;
int V;
 
int vv(int v, int mon)
{
    return v * (l + 1) + mon;
}
 
vector<int> dijkstra(int s, vector<vector<pair<int, int>>> &edge)
{
    const int INF = 1e9;
    vector<int> d(V, INF);
    d[s] = 0;
    priority_queue<pair<int, int>> que; //cost v
    que.push(make_pair(0, s));
    while (!que.empty())
    {
        auto st = que.top();
        que.pop();
        int v = st.second;
        int cost = st.first;
        if (d[v] < cost)
            continue;
        for (int i = 0; i < edge[v].size(); i++)
        {
            int to = edge[v][i].second;
            if (cost + edge[v][i].first < d[to])
            {
                d[to] = cost + edge[v][i].first;
                que.push(make_pair[to], to));
            }
        }
    }
    return d;
}
 
int main()
{
    while (true)
    {
        cin >> n >> m >> l;
        if (n == 0)
            break;
        V = n * (l + 1);
        vector<vector<pair<int, int>>> edge(V); //cost,to
        for (int i = 0; i < m; i++)
        {
            int a, b, d, e;
            cin >> a >> b >> d >> e;
            a--, b--;
            for (int j = 0; j <= l; j++)
            {
                edge[vv(a, j)].push_back(make_pair(e, vv(b, j)));
                edge[vv(b, j)].push_back(make_pair(e, vv(a, j)));
                if (j - d >= 0)
                {
                    edge[vv(a, j)].push_back(make_pair(0, vv(b, j - d)));
                    edge[vv(b, j)].push_back(make_pair(0, vv(a, j - d)));
                }
            }
        }
        vector<int> d = dijkstra(vv(0, l), edge);
        int res = 1e9;
 
        for (int i = 0; i <= l; i++)
        {
            int val=d[vv(n-1,i)];
             
            res = min(res,val);
        }
 
        cout << res << endl;
    }
    return 0;
}
 
    return 0;
}

Compiler output:
a.cc: In function 'std::vector<int> dijkstra(int, std::vector<std::vector<std::pair<int, int> > >&)':
a.cc:32:35: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   32 |                 que.push(make_pair[to], to));
      |                                   ^
a.cc: At global scope:
a.cc:79:5: error: expected unqualified-id before 'return'
   79 |     return 0;
      |     ^~~~~~
a.cc:80:1: error: expected declaration before '}' token
   80 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, m, l;
int V;
 
int vv(int v, int mon)
{
    return v * (l + 1) + mon;
}
 
vector<int> dijkstra(int s, vector<vector<pair<int, int>>> &edge)
{
    const int INF = 1e9;
    vector<int> d(V, INF);
    d[s] = 0;
    priority_queue<pair<int, int>> que; //cost v
    que.push(make_pair(0, s));
    while (!que.empty())
    {
        auto st = que.top();
        que.pop();
        int v = st.second;
        int cost = st.first;
        if (d[v] < cost)
            continue;
        for (int i = 0; i < edge[v].size(); i++)
        {
            int to = edge[v][i].second;
            if (cost + edge[v][i].first < d[to])
            {
                d[to] = cost + edge[v][i].first;
                que.push(make_paird[to], to));
            }
        }
    }
    return d;
}
 
int main()
{
    while (true)
    {
        cin >> n >> m >> l;
        if (n == 0)
            break;
        V = n * (l + 1);
        vector<vector<pair<int, int>>> edge(V); //cost,to
        for (int i = 0; i < m; i++)
        {
            int a, b, d, e;
            cin >> a >> b >> d >> e;
            a--, b--;
            for (int j = 0; j <= l; j++)
            {
                edge[vv(a, j)].push_back(make_pair(e, vv(b, j)));
                edge[vv(b, j)].push_back(make_piar(e, vv(a, j)));
                if (j - d >= 0)
                {
                    edge[vv(a, j)].push_back(make_pair(0, vv(b, j - d)));
                    edge[vv(b, j)].push_back(make_pair(0, vv(a, j - d)));
                }
            }
        }
        vector<int> d = dijkstra(vv(0, l), edge);
        int res = 1e9;
 
        for (int i = 0; i <= l; i++)
        {
            int val=d[vv(n-1,i)];
             
            res = min(res,val);
        }
 
        cout << res << endl;
    }
    return 0;
}
 

Compiler output:
a.cc: In function 'std::vector<int> dijkstra(int, std::vector<std::vector<std::pair<int, int> > >&)':
a.cc:32:26: error: 'make_paird' was not declared in this scope
   32 |                 que.push(make_paird[to], to));
      |                          ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:56:42: error: 'make_piar' was not declared in this scope
   56 |                 edge[vv(b, j)].push_back(make_piar(e, vv(a, j)));
      |                                          ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, m, l;
int V;
 
int vv(int v, int mon)
{
    return v * (l + 1) + mon;
}
 
vector<int> dijkstra(int s, vector<vector<pair<int, int>>> &edge)
{
    const int INF = 1e9;
    vector<int> d(V, INF);
    d[s] = 0;
    priority_queue<pair<int, int>> que; //cost v
    que.push(make_pair(0, s));
    while (!que.empty())
    {
        auto st = que.top();
        que.pop();
        int v = st.second;
        int cost = st.first;
        if (d[v] < cost)
            continue;
        for (int i = 0; i < edge[v].size(); i++)
        {
            int to = edge[v][i].second;
            if (cost + edge[v][i].first < d[to])
            {
                d[to] = cost + edge[v][i].first;
                que.push(make_pair[to], to));
            }
        }
    }
    return d;
}
 
int main()
{
    while (true)
    {
        cin >> n >> m >> l;
        if (n == 0)
            break;
        V = n * (l + 1);
        vector<vector<pair<int, int>>> edge(V); //cost,to
        for (int i = 0; i < m; i++)
        {
            int a, b, d, e;
            cin >> a >> b >> d >> e;
            a--, b--;
            for (int j = 0; j <= l; j++)
            {
                edge[vv(a, j)].push_back(make_pair(e, vv(b, j)));
                edge[vv(b, j)].push_back(make_pair(e, vv(a, j)));
                if (j - d >= 0)
                {
                    edge[vv(a, j)].push_back(make_pair(0, vv(b, j - d)));
                    edge[vv(b, j)].push_back(make_pair(0, vv(a, j - d)));
                }
            }
        }
        vector<int> d = dijkstra(vv(0, l), edge);
        int res = 1e9;
 
        for (int i = 0; i <= l; i++)
        {
            int val=d[vv(n-1,i)];
             
            res = min(res,val);
        }
 
        cout << res << endl;
    }
    return 0;
}
 

Compiler output:
a.cc: In function 'std::vector<int> dijkstra(int, std::vector<std::vector<std::pair<int, int> > >&)':
a.cc:32:35: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   32 |                 que.push(make_pair[to], to));
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, m, l;
int V;
 
int vv(int v, int mon)
{
    return v * (l + 1) + mon;
}
 
vector<int> dijkstra(int s, vector<vector<pair<int, int>>> &edge)
{
    const int INF = 1e9;
vector<int> used(V,0);
    vector<int> d(V, INF);
    d[s] = 0;
    priority_queue<pair<int, int>> que; //cost v
    que.push(make_pair(0, s));
    while (!que.empty())
    {
        auto st = que.top();
        que.pop();
        int v = st.second;
        int cost = st.first;
if(used[v]) continue;
used[v]=true;
        if (d[v] < cost)
            continue;
        for (int i = 0; i < edge[v].size(); i++)
        {
            int to = edge[v][i].second;
            if (cost + edge[v][i].first < d[to])
            {
                d[to] = cost + edge[v][i].first;
                que.push(make_paird[to], to));
            }
        }
    }
    return d;
}
 
int main()
{
    while (true)
    {
        cin >> n >> m >> l;
        if (n == 0)
            break;
        V = n * (l + 1);
        vector<vector<pair<int, int>>> edge(V); //cost,to
        for (int i = 0; i < m; i++)
        {
            int a, b, d, e;
            cin >> a >> b >> d >> e;
            a--, b--;
            for (int j = 0; j <= l; j++)
            {
                edge[vv(a, j)].push_back(make_pair(e, vv(b, j)));
                edge[vv(b, j)].push_back(make_piar(e, vv(a, j)));
                if (j - d >= 0)
                {
                    edge[vv(a, j)].push_back(make_pair(0, vv(b, j - d)));
                    edge[vv(b, j)].push_back(make_pair(0, vv(a, j - d)));
                }
            }
        }
        vector<int> d = dijkstra(vv(0, l), edge);
        int res = 1e9;
 
        for (int i = 0; i <= l; i++)
        {
            int val=d[vv(n-1,i)];
             
            res = min(res,val);
        }
 
        cout << res << endl;
    }
    return 0;
}
 
    return 0;
}

Compiler output:
a.cc: In function 'std::vector<int> dijkstra(int, std::vector<std::vector<std::pair<int, int> > >&)':
a.cc:35:26: error: 'make_paird' was not declared in this scope
   35 |                 que.push(make_paird[to], to));
      |                          ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:59:42: error: 'make_piar' was not declared in this scope
   59 |                 edge[vv(b, j)].push_back(make_piar(e, vv(a, j)));
      |                                          ^~~~~~~~~
a.cc: At global scope:
a.cc:82:5: error: expected unqualified-id before 'return'
   82 |     return 0;
      |     ^~~~~~
a.cc:83:1: error: expected declaration before '}' token
   83 | }
      | ^
Language: C++

#include <iostream>
#include <utility>
#include <stack>
#include <algorithm>

std::pair<int, int> road[101][101]; //first?????¢ second???
int dp[101][101];//[??????][??´???] = ??¢????\????????????°

struct Node {
	int pos, money, attacked;
};

int main() {
	int n, m, l;
	while (std::cin >> n >> m >> l && (n || m || l)) {
		std::memset(dp, 0, sizeof(dp));
		for (int i = 0; i < 101; i++) for (int j = 0; j < 101; j++) road[i][j] = std::make_pair(0, 0);
		for (int i = 0; i < m; i++) {
			int x, y, d, e;
			std::cin >> x >> y >> d >> e;
			road[x][y] = std::make_pair(d, e);
			road[y][x] = std::make_pair(d, e);
		}

		std::stack<Node> s;
		s.push({1, l, 0});

		int min = 1919810;
		while (!s.empty()) {
			auto node = s.top(); s.pop();

			for (int i = 1; i <= n; i++) {
				if (!road[node.pos][i].first) continue;
				auto next = node;
				next.pos = i;

				//????????????
				{
					auto n2 = next;
					n2.attacked += road[node.pos][i].second;
					if (!dp[n2.money][i] || dp[n2.money][i] > next.attacked) {
						if (i == n) min = std::min(min, n2.attacked); //????????????
						else s.push(n2);
						dp[n2.money][i] = n2.attacked;
					}
				}
				//??????
				if (next.money >= road[node.pos][i].first) {
					next.money -= road[node.pos][i].first;
					if (!dp[next.money][i] || dp[next.money][i] > next.attacked) {
						if (i == n) min = std::min(min, next.attacked); //????????????
						else s.push(next);
					}
				}
			}
		}
		std::cout << min << std::endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   16 |                 std::memset(dp, 0, sizeof(dp));
      |                      ^~~~~~
      |                      wmemset
Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
typedef struct E{
  int to,cost,cost2;
}edge;
vector<vector<edge> >E(110);
int memo[110][110];
bool used[110]={};
int n,m,l;
int ans=INF;
void dfs(int now,int nokori,int sum){
  if(now==n){
    ans=min(ans,sum);
    return;
  }
  if(memo[now]<=sum)return;
    memo[now]=sum;
  for(int i=0;i<E[now].size();i++){
    if(used[E[now][i].to]==false){
      used[E[now][i].to]=true;
      if(nokori-E[now][i].cost>=0){
	dfs(E[now][i].to,nokori-E[now][i].cost,sum);
      }
      dfs(E[now][i].to,nokori,sum+E[now][i].cost2);
      used[E[now][i].to]=false;
    }
  }
}
int main(){
  while(cin>>n>>m>>l,n){
    n--;
    ans=INF;
    for(int i=0;i<n+5;i++){
     
      memo[i]=INF;
      E[i].clear();
      used[i]=false;
    }
    for(int i=0;i<m;i++){
      int a,b,d,e;cin>>a>>b>>d>>e;
      a--;b--;
      edge ee;ee.to=b;ee.cost=d;ee.cost2=e;
      E[a].pb(ee);
      ee.to=a;
      E[b].pb(ee);
    }
    dfs(0,l,0);
    cout<<ans<<endl;
  }

  return 0;
}




Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:25:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |   if(memo[now]<=sum)return;
      |      ~~~~~~~~~^~~~~
a.cc:26:14: error: incompatible types in assignment of 'int' to 'int [110]'
   26 |     memo[now]=sum;
      |     ~~~~~~~~~^~~~
a.cc: In function 'int main()':
a.cc:44:14: error: incompatible types in assignment of 'double' to 'int [110]'
   44 |       memo[i]=INF;
      |              ^
Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
typedef struct E{
  int to,cost,cost2;
}edge;
vector<vector<edge> >E(110);
int memo[110]={};
bool used[110]={};
int n,m,l;
int ans=INF;
void dfs(int now,int nokori,int sum){
  if(now==n){
    ans=min(ans,sum);
    return;
  }
  if(memo[nokori][now]<=sum)return;
  for(int i=nokori;i<=l;i++)
    memo[i][now]=sum;
  for(int i=0;i<E[now].size();i++){
    if(used[E[now][i].to]==false){
      used[E[now][i].to]=true;
      if(nokori-E[now][i].cost>=0){
	dfs(E[now][i].to,nokori-E[now][i].cost,sum);
      }
      dfs(E[now][i].to,nokori,sum+E[now][i].cost2);
      used[E[now][i].to]=false;
    }
  }
}
int main(){
  while(cin>>n>>m>>l,n){
    n--;
    ans=INF;
    for(int i=0;i<n+5;i++){
      for(int j=0;j<l+5;j++)
      memo[j][i]=INF;
      E[i].clear();
      used[i]=false;
    }
    for(int i=0;i<m;i++){
      int a,b,d,e;cin>>a>>b>>d>>e;
      a--;b--;
      edge ee;ee.to=b;ee.cost=d;ee.cost2=e;
      E[a].pb(ee);
      ee.to=a;
      E[b].pb(ee);
    }
    dfs(0,l,0);
    cout<<ans<<endl;
  }

  return 0;
}



Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:25:18: error: invalid types 'int[int]' for array subscript
   25 |   if(memo[nokori][now]<=sum)return;
      |                  ^
a.cc:27:12: error: invalid types 'int[int]' for array subscript
   27 |     memo[i][now]=sum;
      |            ^
a.cc: In function 'int main()':
a.cc:45:14: error: invalid types 'int[int]' for array subscript
   45 |       memo[j][i]=INF;
      |              ^
Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
typedef struct E{
  int to,cost,cost2;
}edge;
vector<vector<edge> >E(110);
int memo[110][110]={};
bool used[110]={};
int n,m,l;
int ans=INF;ori-E[now][i].cost>=0){
	dfs(E[now][i].to,nokori-E[now][i].cost,sum);
      }else
      dfs(E[now][i].to,nokori,sum+E[now][i].cost2);
      used[E[now][i].to]=false;
    }
  }
}
int main(){
  while(cin>>n>>m>>l,n){
    n--;
    ans=INF;
    for(int i=0;i<n+5;i++){
      for(int j=0;j<l+5;j++)
      memo[j][i]=INF;
      E[i].clear();
      used[i]=false;
    }
    for(int i=0;i<m;i++){
      int a,b,d,e;cin>>a>>b>>d>>e;
      a--;b--;
      edge ee;ee.to=b;ee.cost=d;ee.cost2=e;
      E[a].pb(ee);
      ee.to=a;
      E[b].pb(ee);
    }
    dfs(0,l,0);
    cout<<ans<<endl;
  }

  return 0;
}



Compiler output:
a.cc:19:13: error: 'ori' does not name a type
   19 | int ans=INF;ori-E[now][i].cost>=0){
      |             ^~~
a.cc:21:8: error: expected unqualified-id before 'else'
   21 |       }else
      |        ^~~~
a.cc:23:7: error: 'used' does not name a type
   23 |       used[E[now][i].to]=false;
      |       ^~~~
a.cc:24:5: error: expected declaration before '}' token
   24 |     }
      |     ^
a.cc:25:3: error: expected declaration before '}' token
   25 |   }
      |   ^
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
a.cc: In function 'int main()':
a.cc:45:5: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   45 |     dfs(0,l,0);
      |     ^~~
      |     ffs
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)

const int MAXN = 101, MAXL = 101, INF = 110000 ;
int d[MAXN][MAXL];

struct edge{int to, dist, enemy;};

int n, m, l, a, b, dist, e;

typedef pair<int, int> pp;
typedef pair<int, pp> ppp;

int main()
{
    while(cin >> n >> m >> l && n)
    {
        //memset(d , INF, sizeof(int) * MAXN * MAXL);
        rep(i,n)rep(j,l + 1)d[i][j] = 110000 ;
        vector<edge> g[MAXN];
        REP(m)
        {
            cin >> a >> b >> dist >> e;
            a--; b--;
            g[a].push_back((edge){b, dist, e});
            g[b].push_back((edge){a, dist, e});
        }

        priority_queue<ppp, vector<ppp>, greater<ppp> > que;
        que.push(ppp(0, pp( -l , 0)));
        d[0][l] = 0;
        int ans = 1000;

        //cout << d[1][l] << endl;

        while(!que.empty())
        {
            ppp p = que.top(); que.pop();
            int nowe = p.first, nowl = -p.second.first, now = p.second.second;
            //cout << "e:" << nowe << "  l:" << nowl << "  now:" << now << endl;
            if(now ==

Compiler output:
a.cc: In function 'int main()':
a.cc:52:22: error: expected primary-expression at end of input
   52 |             if(now ==
      |                      ^
a.cc:52:22: error: expected ')' at end of input
   52 |             if(now ==
      |               ~      ^
      |                      )
a.cc:52:22: error: expected statement at end of input
a.cc:52:22: error: expected '}' at end of input
a.cc:48:9: note: to match this '{'
   48 |         {
      |         ^
a.cc:52:22: error: expected '}' at end of input
   52 |             if(now ==
      |                      ^
a.cc:28:5: note: to match this '{'
   28 |     {
      |     ^
a.cc:52:22: error: expected '}' at end of input
   52 |             if(now ==
      |                      ^
a.cc:26:1: note: to match this '{'
   26 | {
      | ^
Language: C++

#include <stdio.h>
#include <queue>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

typedef pair<int,int> P;
typedef pair<int,P> PP;

int main(void){
	int n, m, l, a, b, d[100][100], e[100][100], f[100][101], i, j, k, x, y, z, mn;
	priority_queue<PP,vector<PP>,greater<PP> > que;
	while(1){
		scanf("%d%d%d",&n,&m,&l);
		if(n + m + l == 0) break;
		memset(d,-1,sizeof(d));
		memset(e,-1,sizeof(e));
		for(i = 0;i < m;i++){
			scanf("%d%d%d%d",&a,&b,&j,&k);
			d[a - 1][b - 1] = j;
			d[b - 1][a - 1] = j;
			e[a - 1][b - 1] = k;
			e[b - 1][a - 1] = k;
		}
		memset(f,-1,sizeof(f));
		f[0][l] = 0;
		que.push(PP(0,P(l,0))); // 敵との合流回数 お金 町の番号
		while(que.size()){
			x = que.top().first, y = que.top().second.first, z = que.top().second.second;
			que.pop();
			for(i = 0;i < n;i++){
				if(d[z][i] != -1){
					if(y >= d[z][i] && (f[i][y - d[z][i]] == -1 || f[i][y - d[z][i]] > f[z][y])){
						que.push(PP(x,P(y - d[z][i],i)));
						f[i][y - d[z][i]] = x;
					}
					if(f[i][y] == -1 || f[i][y] > x + e[z][i]){
						que.push(PP(x + e[z][i],P(y,i)));
						f[i][y] = x + e[z][i];
					}
				}
			}
		}
		mn = 0x7FFFFFFF;
		for(i = 0;i <= l;i++)
			if(f[n - 1][i] != -1) mn = min(mn,f[n - 1][i]);
		printf("%d\n",mn);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'memset' was not declared in this scope
   18 |                 memset(d,-1,sizeof(d));
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <utility>
  +++ |+#include <cstring>
    6 |
Language: Java

import java.util.*;

public class AOJ2152
{

  

    public static void main(String args[])
    {
	Scanner in = new Scanner(System.in);
	int N;
	boolean aaa = true;
	while(true)
	    {

		N = in.nextInt();
		if(N == 0)break;

		if(!aaa)System.out.println();
		aaa = false;
		LinkedList<P> list = new LinkedList<P>();
		list.add(new P(0,0,-1));

		String c;
		int I,S;
		for(int i=0;i<N;i++)
		    {
			c = in.next();
			if(c.equals("W"))
			    {
				I = in.nextInt();
				S = in.nextInt();
				for(int j=0;j<list.size()-1;j++)
				    {	
					int v1 = list.get(j).r;
					int v2 = list.get(j+1).l;
					if(v1 == v2)continue;
					//System.out.println("add ! " + j + " " + v1 + " " + v2);
					list.add(j+1,new P(v1,Math.min((v2-v1)+v1,v1+S),I) ); 
					S -= (v2-v1);
					if(S < 0)S = 0;

					if(S == 0)break;
				    }
				if(S != 0)
				    {

						int lass = (list.size()-1 >= 0?list.get(list.size()-1).r:0);
						list.add(new P(lass,lass+S,I));

				    }
					
			    }
			else if(c.equals("D"))
			    {
				I = in.nextInt();
				for(int j=1;j<list.size();j++)
				    {
					int v = list.get(j).id;
					if(v == I)
					    {
						P p = list.remove(j);
					    }
				    }
			    }
			else
			    {
				I = in.nextInt();
				boolean found = false;
				for(int j=1;j<list.size();j++)
				    {
					P p = list.get(j);
					if(p.l <= I && I < p.r)
					    {
						found = true;
						System.out.println(p.id);
						break;
					    }
				    }
				if(!found)System.out.println(-1);
			    }
			/*
			System.out.println("------------");
			for(int j=0;j<list.size();j++)
			    {
				System.out.println(list.get(j).l + " - " +list.get(j).r + " : " + list.get(j).id);
			    }
			System.out.println("------------");
			*/
		    }

	    }
    }
}

class P
{
    public int r,l,id;
    P(int rl,int rr,int rid)
    {
	r = rr;
	l = rl;
	id = rid;
    }
}

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

#include<stdio.h>
int F[1000000000],R[1000000000];
int main()
{
  int i,j,t=0,n,y,x;
  char ch;
  
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<1000000000;i++){
      F[i]=-1;
    }
    
    for(i=0;i<n*2;i++){
      scanf("%c",&ch);
      if(ch=='W'){
        scanf("%d%d",&x,&y);
        for(j=0;y!=0;j++){
          if(F[j]==-1){
            F[j]=x;
	    y--;
	  }
	}
      }
      if(ch== 'D'){
        scanf("%d",&x);
        for(j=0;j<1000000001;j++){
          if(F[j]==x){
	    F[j]= -1;
	  }
	}
      }
      if(ch=='R'){
        scanf("%d",&x);
        R[t]=F[x-1];
        t++;
      }
    }
    for(i=0;i<t;i++){
      printf("%d\n",R[i]);
    }
    printf("\n");
    t=0;
  
  }
  return 0;
}

Compiler output:
/tmp/cc6KbKFl.o: in function `main':
main.c:(.text+0x1c8): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc6KbKFl.o
main.c:(.text+0x1fe): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc6KbKFl.o
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#define SS 1000000000
int F[SS],R[SS];
int main()
{
  int i,j,t=0,n,y,x;
  char ch;
  
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<SS;i++){
      F[i]=-1;
    }
    
    for(i=0;i<n*2;i++){
      scanf("%c",&ch);
      if(ch=='W'){
        scanf("%d%d",&x,&y);
        for(j=0;y!=0;j++){
          if(F[j]==-1){
            F[j]=x;
	    y--;
	  }
	}
      }
      if(ch== 'D'){
        scanf("%d",&x);
        for(j=0;j<SS;j++){
          if(F[j]==x){
	    F[j]= -1;
	  }
	}
      }
      if(ch=='R'){
        scanf("%d",&x);
        R[t]=F[x-1];
        t++;
      }
    }
    for(i=0;i<t;i++){
      printf("%d\n",R[i]);
    }
    printf("\n");
    t=0;
  
  }
  return 0;
}

Compiler output:
/tmp/cck8pD24.o: in function `main':
main.c:(.text+0x1c8): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cck8pD24.o
main.c:(.text+0x1fe): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cck8pD24.o
collect2: error: ld returned 1 exit status
Language: C++

/*
	2152: Restrictive Filesystem
*/
#include	<iostream>
#include	<queue>
#include	<utility>
#include	<algorithm>

using namespace std;

typedef pair<int, int> P_ii;

class datlst {
private:
	priority_queue<P_ii> lst;
public:
	void push_file(int, int);
	void erase_file(int);
};

void datlst::push_file(int ident, int count) {
	for (int i = 0; i < count; i++) {
		if (lst.empty()) {
			lst.push(P_ii(0, ident));
		}
		priority_queue<P_ii>::iterator it = lst.begin();
	}
}

int main(void) {
	int		N, f, s;
	char	c;
	while (1) {
		cin >> N;
		if (N == 0) { break; }
		for (int i = 0; i < N; i++) {
			cin >> c;
			switch (c) {
			case 'W':
				cin >> f >> s;
				for (int j = 0; j < s; j++) {

				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In member function 'void datlst::push_file(int, int)':
a.cc:26:39: error: 'iterator' is not a member of 'std::priority_queue<std::pair<int, int> >'
   26 |                 priority_queue<P_ii>::iterator it = lst.begin();
      |                                       ^~~~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

struct data{
	int lidl,ridl;
	int idl;
	int l,r;
	data(){}
	data(int iidl,int ll,int rr,int lll,int rrr){
		idl=iidl;
		lidl=ll;
		ridl=rr;
		l=lll;
		r=rrr;
	}
};

vector<data> dat;
map<int,int> idl;
vector<int> idldata;
vector<int> placee[10001];
int n;
int st,en;

int main(voidl){
	while(1){
		dat.clear();
		idl.clear();
		idldata.clear();
		st=-1;
		en=-1;
		scanf("%d%*c",&n);
		if(n==0)break;
		for(int i=0;i<n;i++){
			char c;
			scanf("%c",&c);
			if(c=='W'){
				int l,s;
				scanf("%d %d%*c",&l,&s);
				if(idl.find(l)==idl.end()){
					idl[l]=idldata.size();
					idldata.push_back(l);
					placee[idl[l]].clear();
				}
				if(dat.size()==0 || st==-1){
					dat.push_back(data(idl[l],-1,-1,0,s));
					st=dat.size()-1;
					en=dat.size()-1;
					placee[idl[l]].push_back(dat.size()-1);
				}else{
					int v=0;
					int nv=st;
					if(dat[st].l>0){
						dat.push_back(data(idl[l],-1,st,0,min(s,dat[st].l)));
						placee[idl[l]].push_back(dat.size()-1);
						dat[st].lidl=dat.size()-1;
						s-=min(s,dat[st].l);
						st=dat.size()-1;
					}
					nv=dat[nv].ridl;
					while(s>0 && nv!=-1){
						if(dat[nv].l!=dat[dat[nv].lidl].r){
							dat.push_back(data(idl[l],dat[nv].lidl,nv,dat[dat[nv].lidl].r,dat[dat[nv].lidl].r+min(s,dat[nv].l-dat[dat[nv].lidl].r)));
							placee[idl[l]].push_back(dat.size()-1);
							s-=min(s,dat[nv].l-dat[dat[nv].lidl].r);
							dat[dat[nv].lidl].ridl=dat.size()-1;
							dat[nv].lidl=dat.size()-1;
						}
						nv=dat[nv].ridl;
					}
					if(s>0){
						dat.push_back(data(idl[l],en,-1,dat[en].r,dat[en].r+s));
						placee[idl[l]].push_back(dat.size()-1);
						dat[en].ridl=dat.size()-1;
						en=dat.size()-1;
					}
				}
			}
			if(c=='D'){
				int l;
				scanf("%d%*c",&l);
				if(idl.find(l)==idl.end())continue;
				for(int i=0;i<placee[idl[l]].size();i++){
					data d=dat[placee[idl[l]][i]];
					if(d.lidl==-1)st=d.ridl;
					if(d.ridl==-1)en=d.lidl;
					dat[d.ridl].lidl=d.lidl;
					dat[d.lidl].ridl=d.ridl;
				}
				placee[idl[l]].clear();
			}
			if(c=='R'){
				int p;
				scanf("%d%*c",&p);
				int nv=st;
				if(nv!=-1){
					while(dat[nv].r<=p){
						nv=dat[nv].ridl;
						if(nv==-1)break;
					}
				}
				if(nv!=-1)printf("%d\n",(dat[nv].l<=p && p<dat[nv].r)?idldata[dat[nv].idl]:-1);
				else printf("-1\n");
			}
			/*
			printf("%d %d\n",st,en);
			for(int i=st;i!=-1;i=dat[i].ridl){
				printf("%d %d %d %d %d\n",dat[i].idl,dat[i].lidl,dat[i].ridl,dat[i].l,dat[i].r);
			}
			*/
		}
		printf("\n");
	}
	return 0;
}

Compiler output:
a.cc:22:12: error: template argument 1 is invalid
   22 | vector<data> dat;
      |            ^
a.cc:22:12: error: template argument 2 is invalid
a.cc:29:5: error: cannot declare '::main' to be a global variable
   29 | int main(voidl){
      |     ^~~~
a.cc:29:10: error: 'voidl' was not declared in this scope; did you mean 'void'?
   29 | int main(voidl){
      |          ^~~~~
      |          void