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

#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
const int maxn  = 1e4+10;
const int INF = 0x3f3f3f3f;
typedef pair<int,int> P;
struct edge{
	int to,dis,cost;
		
};

int d[maxn];
int value[maxn];

int N,M;

int dijkstra(vector<edge>G[])
{

	memset(d,INF,sizeof(d));
	memset(value,INF,sizeof(value));
	priority_queue<P,vector<P>,greater<P> > que;
		
	d[1] = 0;
	value[1] = 0;
	que.push(P(d[1],1));
	
	int res = 0;
	while(!que.empty())
	{
		P p  = que.top(); que.pop();
		
		int v = p.second;
		if(d[v] < p.first)
			continue;
			
		res += value[v];
		
		for(int i = 0; i < G[v].size(); i++)
		{
			edge e = G[v][i];
			if(d[e.to] == d[v] + e.dis)
				value[e.to] = min(value[e.to],e.cost);
			if(d[e.to] > d[v] + e.dis)
			{
				d[e.to] = d[v] + e.dis;
				que.push(P(d[e.to],e.to));
				
				value[e.to] = e.cost;
			}
		}
	}
	return res;
	
}

int main()
{

	//freopen("c:\\users\\administrator\\desktop\\in.txt","r",stdin);
	while(cin >> N >> M, N||M)
	{
		
		vector<edge> G[maxn];
		for(int i =0; i < M; i++)
		{
			int u,v,d,c;
			edge e;
			cin >> u >> v >> d >> c;
			e.to= v, e.dis= d, e.cost =c;
			G[u].push_back(e);
			e.to= u;
			G[v].push_back(e);	
		}
		
		int res = dijkstra(G);
		cout << res <<endl;
	}		
} 

Compiler output:
a.cc: In function 'int dijkstra(std::vector<edge>*)':
a.cc:22:9: error: 'memset' was not declared in this scope
   22 |         memset(d,INF,sizeof(d));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<algorithm>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <vector>
#include <iostream>
#include <queue>
using namespace std;
typedef long long ll;
#define fi first
#define se second
const int INF=0x3f3f3f3f;
#define N int(2e5+5)

struct e{
	int to,d,c;
	e(int x,int y,int z):to(x),d(y),c(z){}
};
int n,m,s[N];
bool operator<(e e1,e e2){
	if(e1.d!=e2.d)return e1.d>e2.d;
	else return e1.c>e2.c;
}

ll dijkstra(vector<e> g[]){
	memset(s,0,sizeof(s));
	int cnt=1;
	priority_queue<e> q;
	vector<int> dist(n+1,INF);
	dist[1]=0;
	for(int i=0;i<g[1].size();i++){
		q.push(g[1][i]);
		dist[g[1][i].to]=g[1][i].d;
	}
	s[1]=1;
	ll ret=0;
	while(cnt<n){
		while(s[q.top().to])q.pop();
		e x=q.top();
		q.pop();
		ret+=x.c;
		s[x.to]=1;
		for(int i=0;i<g[x.to].size();i++){
			if(dist[g[x.to][i].to]>=x.d+g[x.to][i].d){
				dist[g[x.to][i].to]=x.d+g[x.to][i].d;
				q.push(e(g[x.to][i].to,dist[g[x.to][i].to],g[x.to][i].c));
			}
		}
		cnt++;
	}
	return ret;
}

int main(){
	ios::sync_with_stdio(false);
	while(cin>>n>>m){
		if(n==0 && m==0)break;
		vector<e> g[N];
		int u,v,d,c;
		for (int i = 0; i < m; i++){
			cin>>u>>v>>d>>c;
			g[u].push_back(e(v,d,c));
			g[v].push_back(e(u,d,c));
		}
		cout<<dijkstra(g)<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'll dijkstra(std::vector<e>*)':
a.cc:22:9: error: 'memset' was not declared in this scope
   22 |         memset(s,0,sizeof(s));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <queue>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <map>
#include <string>
#include <sstream>
#include <set>
#include <bitset>
#include <cmath>
using namespace std;

typedef pair<int, int> P;

const int maxn = 10000 + 5, maxm = 20000 + 5, INF = 0x3f3f3f3f;

int cnt, head[maxn], nxt[maxm << 1], to[maxm << 1], dist[maxm << 1], cost[maxm << 1];

int n, m, d[maxn];

int main() {
    while (cin >> n >> m && n) {
        cnt = 0;
        memset(head, 0, sizeof(head));
        for (int i = 1; i <= m; ++i) {
            int u, v, d, c; cin >> u >> v >> d >> c;
            nxt[++cnt] = head[u];
            head[u] = cnt;
            to[cnt] = v;
            dist[cnt] = d;
            cost[cnt] = c;
            nxt[++cnt] = head[v];
            head[v] = cnt;
            to[cnt] = u;
            dist[cnt] = d;
            cost[cnt] = c;
        }
        priority_queue<P, vector<P>, greater<P> > pq;
        fill(d, d + maxn, INF);
        d[1] = 0;
        pq.push(P(0, 1));
        while (!pq.empty()) {
            P p = pq.top(); pq.pop();
            int v = p.second;
            if (d[v] < p.first) continue;
            for (int i = head[v]; i; i = nxt[i])
                if (d[v] + dist[i] < d[to[i]]) {
                    d[to[i]] = d[v] + dist[i];
                    pq.push(P(d[to[i]], to[i]));
                }
        }
        int sum = 0;
        for (int i = 2; i <= n; ++i) {
            int min_cost = INF;
            for (int j = head[i]; j; j = nxt[j])
                if (d[to[j]] + dist[j] == d[i] && cost[j] < min_cost) min_cost = cost[j];
            sum += min_cost;
        }
        cout << sum << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
   24 |         memset(head, 0, sizeof(head));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cmath>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
struct edge{
	short dis;
	short cost;
};
const int INF=1e9;
edge chart[9198][9198];
int N,M;
bool used[10000];
int d[10000];
int cost[10000];
void dijkstra(int start){
	fill(d,d+N,INF);
	fill(used,used+N,false);
	fill(cost,cost+N,INF);
	d[start]=0;
	cost[start]=0;
	while(true)
	{
		int v=-1;
		for(int i=0;i<N;i++)
		if(!used[i]&&(v==-1||d[i]<d[v]))
		v=i;
		if(v==-1) break;
		used[v]=true;
		for(int i=0;i<N;i++){
			if(d[i]==d[v]+chart[v][i].dis){
				cost[i]=min(cost[i],chart[v][i].cost);
				continue;
			}
			if(d[i]>d[v]+chart[v][i].dis){
				d[i]=d[v]+chart[v][i].dis;
				cost[i]=chart[v][i].cost;
			}
        }
	}
}
void solve(){
	while(cin>>N>>M)
	{
		if(N==0) break;
		for(int i=0;i<N;i++)
		for(int j=0;j<N;j++)
		{
			chart[i][j].dis=INF;
			chart[i][j].cost=INF;
		}
		for(int i=0;i<M;i++)
		{
			int a,b;
			cin>>a>>b;
			cin>>chart[a-1][b-1].dis>>chart[a-1][b-1].cost;
			chart[b-1][a-1]=chart[a-1][b-1];
		}
		dijkstra(0);
		int sum=0;
		for(int i=0;i<N;i++)
		sum+=cost[i];
		cout<<sum<<endl;
	}
}
int main(){
	solve();
}


Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:29:44: error: no matching function for call to 'min(int&, short int&)'
   29 |                                 cost[i]=min(cost[i],chart[v][i].cost);
      |                                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:29:44: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'short int')
   29 |                                 cost[i]=min(cost[i],chart[v][i].cost);
      |                                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
a.cc: In function 'void solve()':
a.cc:46:41: warning: overflow in conversion from 'int' to 'short int' changes value from '1000000000' to '-13824' [-Woverflow]
   46 |                         chart[i][j].dis=INF;
      |                                         ^~~
a.cc:47:42: warning: overflow in conversion from 'int' to 'short int' changes value from '1000000000' to '-13824' [-Woverflow]
   47 |                         chart[i][j].cost=INF;
      |                                          ^~~
Language: C++

/*
 * H.cpp
 *
 *  Created on: 2010/11/28
 *      Author: Computer Club
 */

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

class State
{
public:
	int p,d,c,pv;
	State(int p, int d, int c, int pv)
	:p(p),d(d),c(c),pv(pv)
	 {}

	bool operator<(const State& s) const
	{
		if(d!=s.d) return d>s.d;
		return c>s.c;

	}
};

class Edge
{
public:
	int v,c,d;
	Edge(){}
	Edge(int v, int d, int c)
	:v(v),c(c),d(d)
	 {}
};

typedef vector<Edge> G;

int main()
{
	//ifstream cin("H.txt");

	int N,M;
	while(cin >> N >>M,(N||M))
	{
		vector<G> edges(10009);
		for(int i=0; i<M; i++)
		{
			int u,v,d,c;
			cin >> u >> v >> d >> c;
			u--; v--;
			edges[u].push_back(Edge(v,d,c));
			edges[v].push_back(Edge(u,d,c));
		}



		int mov[10009];
		memset(mov,-1,sizeof(mov));
		mov[0]=0;

		priority_queue<State> q;
		q.push(State(0,0,0,0));
		while(!q.empty())
		{
				State s=q.top(); q.pop();

				if(mov[s.p]==-1)
				{
					mov[s.p]=s.pv;
					s.c=0;
				}

				for(int i=0; i<edges[s.p].size(); i++)
				{
					Edge e=edges[s.p][i];
					if(mov[e.v]!=-1) continue;
					q.push(State(e.v,e.d+s.d,e.c+s.c,s.p));
				}

		}

		int ans = 0;
		bool visit[10009];
		memset(visit,0,sizeof(visit));
		visit[0] = 1;

		for(int i=0; i<N; i++)
		{
			int rtn = i;
			while(visit[rtn]==0)
			{
				visit[rtn] = 1;

				int prevrtn = mov[rtn];
				for(int e=0; e<edges[prevrtn].size(); e++)
				{
					if(edges[prevrtn][e].v == rtn)
					{
						//cout << prevrtn << "->" << rtn << endl;
						ans += edges[prevrtn][e].c;
					}
				}
				rtn = prevrtn;
			}
		}

		cout << ans << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:17: error: 'memset' was not declared in this scope
   63 |                 memset(mov,-1,sizeof(mov));
      |                 ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <algorithm>
  +++ |+#include <cstring>
   13 | using namespace std;
Language: C++

#include <aglorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#define INF 10005

using namespace std;
struct EDGE {
	int i; bool vis; EDGE *next,*ani;
}	*Edge[INF], E[INF<<2];
int n, m, block, tot;
int du[INF];
int fa[INF];
int path[INF];
void _addedge(int i, int j, EDGE &e1, EDGE &e2)
{
	e1.i=j, e1.vis=true, e1.ani=&e2, e1.next=Edge[i], Edge[i]=&e1;
	e2.i=i, e2.vis=true, e2.ani=&e1, e2.next=Edge[j], Edge[j]=&e2;
}
void init()
{
	memset(fa, 0, sizeof(fa));
	memset(du, 0, sizeof(du));
	scanf("%d %d", &n, &m); block=n;
	for (int i=1; i<=n; i++) fa[i]=1;
	for (int i=1; i<=m; i++)
	{
		int x, y;
		scanf("%d %d", &x, &y);
		_addedge(x, y, E[cnt+1], E[cnt+2]), cnt+=2;
		du[x]++, du[y]++;
		merge(x, y);
	}
}

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

#include<stdio.h>
#include<utility>
#include<queue>
#include<vector>
#include<limits>
#include<algorithm>
#define MAX_N 10000
#define INF INT_MAX
using namespace std;

typedef pair<int,int>P;

typedef struct edge
{
	int t,dist,cost;
} edge;

struct StructGreater {
	bool operator() (edge a, edge b) {
		return a.dist==b.dist?a.cost>b.cost:a.dist>b.dist;
	}
};

vector<edge>G[MAX_N];

int N,M,mincost[MAX_N],mindist[MAX_N];

int prim()
{
	int flg[MAX_N];
	priority_queue<edge,vector<edge>,StructGreater>que;
	for(int i=0;i<N;i++)
	{
		mindist[i]=INF;
		mincost[i]=INF;
		flg[i]=0;
	}
	mincost[0]=0;
	edge t1={0,0,0};
	que.push(t1);
	int res=0;
	while(!que.empty())
	{
		edge tmp=que.top();
		que.pop();
		if(!flg[tmp.t])
		{
			res+=tmp.cost;
			mindist[tmp.t]=tmp.dist;
			mincost[tmp.t]=tmp.cost;
			flg[tmp.t]=1;
			for(int u=0;u<G[tmp.t].size();u++)
				if(mindist[G[tmp.t][u].t]>G[tmp.t][u].dist&&mincost[G[tmp.t][u].t]>G[tmp.t][u].cost)
				{
					edge t2={G[tmp.t][u].t,mindist[tmp.t]+G[tmp.t][u].dist,G[tmp.t][u].cost};
					que.push(t2);
				}
		}
	}
	return res;
}

int main()
{
	for(;scanf("%d%d",&N,&M),N,M;)
	{
		for(int i=0;i<M;i++)
		{
			int a,b,c,d;
			scanf("%d%d%d%d",&a,&b,&c,&d);
			a--,b--;
			edge t1={b,c,d};
			edge t2={a,c,d};
			G[a].push_back(t1);
			G[b].push_back(t2);
		}
		printf("%d\n",prim());
		for(int i=0;i<N;i++)
			G[i].clear();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int prim()':
a.cc:8:13: error: 'INT_MAX' was not declared in this scope
    8 | #define INF INT_MAX
      |             ^~~~~~~
a.cc:34:28: note: in expansion of macro 'INF'
   34 |                 mindist[i]=INF;
      |                            ^~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include<algorithm>
  +++ |+#include <climits>
    7 | #define MAX_N 10000
Language: C++


#include <cstdio>
#include <vector>
#include <queue>

using namespace std;

struct Node {
	int id;
	int d;
	int c;
};

vector<Node> G[10001];
int N, M;

typedef bool (*compare_node_type)(const Node &n1, const Node &n2);

bool compare_node_big(const Node &n1, const Node &n2)
{
	if (n1.d != n2.d)
		return n1.d > n2.d;
	if (n1.c != n2.c)
		return n1.c > n2.c;
	return n1.id > n2.id;

}

void dijistra(int src, vector<Node> &dist_v)
{
	priority_queue<Node, vector<Node>, compare_node_type> queue(compare_node_big);

	dist_v.resize(N+1);
	int i, j;
	Node node;

	for (i=1; i<=N; i++) {
		dist_v[i].d = INT_MAX;
	}
	dist_v[src].d = 0;
	dist_v[src].c = 0;
	node.id = src; node.d = 0; node.c = 0;
	queue.push(node);

	while (!queue.empty()) {
		node = queue.top(); queue.pop();
		if (node.d > dist_v[node.id].d ||
			node.c > dist_v[node.id].c)
			continue;

		int id = node.id;
		int d = node.d;

		for (i=0; i<G[id].size(); i++) {
			int nid = G[id][i].id;
			if (dist_v[nid].d > d+G[id][i].d ||
				dist_v[nid].d == d+G[id][i].d && dist_v[nid].c > G[id][i].c) {
				dist_v[nid].d = d+G[id][i].d;
				dist_v[nid].c = G[id][i].c;
				dist_v[nid].id = nid;

				queue.push(dist_v[nid]);
			}

		}


	}


}

int main()
{
	//freopen("in.txt", "r", stdin);

	while (scanf("%d%d", &N, &M)==2) {
		if (N==0 && M==0) break;
		int i, j;
		Node node;

		for (i=1; i<=N; i++)
			G[i].clear();

		for (i=0; i<M; i++) {
			int u, v, d, c;
			scanf("%d%d%d%d", &u, &v, &d, &c);
			node.id = v; node.d = d; node.c = c;
			G[u].push_back(node);
			node.id = u;
			G[v].push_back(node);

		}

		vector<Node> dist_v;

		dijistra(1, dist_v);

		int cost = 0;
		for (i=1; i<=N; i++)
			cost += dist_v[i].c;
		printf("%d\n", cost);



	}

	return 0;
}

Compiler output:
a.cc: In function 'void dijistra(int, std::vector<Node>&)':
a.cc:38:31: error: 'INT_MAX' was not declared in this scope
   38 |                 dist_v[i].d = INT_MAX;
      |                               ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <queue>
  +++ |+#include <climits>
    5 |
Language: C++

//AOJ Road Construction 2249
//先保&#35777;最短路径,再保&#35777;最小花&#36153;
//update:5/30...
#include <iostream>
#include <vector>
#include <queue>
#include <functional>
#include <algorithm>
using namespace std;

#define MAX_V 10005
#define MAX_E 20005

struct edge{
	int to, dist, cost;
	edge(int to=0,int dist=0,int cost=0):
		to(to), dist(dist), cost(cost){}
};
int d[MAX_V];
vector<edge>G[MAX_V];
//前&#39537;&#32467;点 注意不要个prev迭代器混淆
vector<edge>Prev[MAX_V];
//距&#31163; &#33410;点
typedef pair<int, int>P;
int N, M;
void dijstra(){
	memset(d, 0x3f, sizeof(d));
	for (int i = 0; i < N; i++) Prev[i].clear();
	priority_queue<P, vector<P>, greater<P> >que;
	d[0] = 0;
	que.push(P(0, 0));
	while (!que.empty()){
		auto cur = que.top(); que.pop();
		int v = cur.second;
		if (d[v] < cur.first)continue;
		for (auto& k : G[v]){
			if (d[k.to]>d[v] + k.dist){
				d[k.to] = d[v] + k.dist;
				Prev[k.to].clear();
				Prev[k.to].push_back(k);
				que.push(P(d[k.to], k.to));
			}
			else if (d[k.to] == d[v] + k.dist)
				Prev[k.to].push_back(k);
		}
	}
}
int cost(int v){
	int min_cost = 0x3f3f3f3f;
	for (int i = 0; i < Prev[v].size(); ++i)
		min_cost = min(min_cost, Prev[v][i].cost);
	return min_cost;
}

int main()
{

	while (cin >> N >> M){
		for (int i = 0; i < N; ++i)G[i].clear();
		for (int i = 0; i < N; ++i)Prev[i].clear();
		if (!N&&!M)
			return 0;
		int a, b, c, d;
		for (int i = 0; i < M; ++i){
			cin >> a >> b >> c >> d;
			--a; --b;
			G[a].push_back(edge(b, c, d));
			G[b].push_back(edge(a, c, d));
		}
		dijstra();
		int res = 0;
		for (int i = 1; i < N; ++i)
			res += cost(i);
		cout << res << "\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'void dijstra()':
a.cc:27:9: error: 'memset' was not declared in this scope
   27 |         memset(d, 0x3f, sizeof(d));
      |         ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <algorithm>
  +++ |+#include <cstring>
    9 | using namespace std;
Language: C++

#include<iostream>
#define M 1001
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
int n,t,m[M],l[M],k[M],add[M*M];
bool used[M];
bool ch(int x){
  memset(add,0,sizeof(add));
  memset(used,0,sizeof(used));
  int cnt=0;
  r(i,t+1){
    x+=add[i];
    r(j,n)if(!used[j]){
      int p=l[j]+k[j];
      if(i%p<=l[j]&&x){
	add[i+m[j]]++;
	used[j]=1;
	x--;
	cnt++;
      }
    }
  }
  return cnt==n;
}
int main(){
  while(cin>>n>>t,t){
    r(i,n)cin>>m[i]>>l[i]>>k[i];
    r(i,M){
      if(ch(i)){
	cout<<i<<endl;
	break;
      }
    }
  }
}

Compiler output:
a.cc: In function 'bool ch(int)':
a.cc:8:3: error: 'memset' was not declared in this scope
    8 |   memset(add,0,sizeof(add));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #define M 1001
Language: C++

#include<iostream>
#define M 1001
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
int n,t,m[M],l[M],k[M],add[M];
bool used[M];
bool ch(int x){
  memset(add,0,sizeof(add));
  memset(used,0,sizeof(used));
  int cnt=0;
  r(i,t+1){
    x+=add[i];
    r(j,n)if(!used[j]){
      int p=l[j]+k[j];
      if(i%p<=l[j]&&x){
	if(m[j]+i<M)add[i+m[j]]++;
	used[j]=1;
	x--;
	cnt++;
      }
    }
  }
  return cnt==n;
}
int main(){
  while(cin>>n>>t,t){
    r(i,n)cin>>m[i]>>l[i]>>k[i];
    r(i,M){
      if(ch(i)){
	cout<<i<<endl;
	break;
      }
    }
  }
}

Compiler output:
a.cc: In function 'bool ch(int)':
a.cc:8:3: error: 'memset' was not declared in this scope
    8 |   memset(add,0,sizeof(add));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #define M 1001
Language: C++

#include<iostream>
#define M 1001
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
int n,t,m[M],l[M],k[M],add[M];
bool used[M];
bool ch(int x){
  memset(add,0,sizeof(add));
  memset(used,0,sizeof(used));
  int cnt=0;
  r(i,t+1){
    x+=add[i];
    r(j,n)if(!used[j]&&x){
      int p=l[j]+k[j];
      if(i%p<=l[j]&&m[j]+i<M){
        add[i+m[j]]++;
	used[j]=1;
	x--;
	cnt++;
      }
    }
  }
  return cnt==n;
}
int main(){
  while(cin>>n>>t,t){
    r(i,n)cin>>m[i]>>l[i]>>k[i];
    r(i,M){
      if(ch(i)){
	cout<<i<<endl;
	break;
      }
    }
  }
}

Compiler output:
a.cc: In function 'bool ch(int)':
a.cc:8:3: error: 'memset' was not declared in this scope
    8 |   memset(add,0,sizeof(add));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #define M 1001
Language: C++

#include<iostream>
#define M 1005
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
int n,t,m[M],l[M],k[M],add[M];
bool used[M];
bool ch(int x){
  memset(add,0,sizeof(add));
  memset(used,0,sizeof(used));
  int cnt=0;
  r(i,t+1){
    x+=add[i];
    r(j,n)if(!used[j]&&x){
      int p=l[j]+k[j];
      if(i%p<=l[j]&&m[j]+i<M){
        add[i+m[j]]++;
	used[j]=1;
	x--;
	cnt++;
      }
    }
  }
  return cnt==n;
}
int main(){
  while(cin>>n>>t,t){
    r(i,n)cin>>m[i]>>l[i]>>k[i];
    r(i,M){
      if(ch(i)){
	cout<<i<<endl;
	break;
      }
    }
  }
}

Compiler output:
a.cc: In function 'bool ch(int)':
a.cc:8:3: error: 'memset' was not declared in this scope
    8 |   memset(add,0,sizeof(add));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #define M 1005
Language: C++

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
typedef long long LL;
using namespace std;

struct node{
    int i,w;
    node(int _i=0,int _w=0){
        i=_i; w=_w;
    }
    bool operator<(const node &t)const{
        return w>t.w;
    }
};
int N,T,M[1100],L[1100],K[1100];

int b[1100]={0},in[1100]={0};     
priority_queue<node> hang,wait,dial;
priority_queue<int,vector<int>,greater<int> > Q;

bool gao(int rest){
    memset(b,0,sizeof(b));
    memset(in,0,sizeof(in));
    while (!hang.empty()) hang.pop();
    while (!wait.empty()) wait.pop();
    while (!dial.empty()) dial.pop();
    while (!Q.empty()) Q.pop();
    int t,i;
    for (i=1;i<=N;i++){
        hang.push(node(i,0));
    }
    for (t=0;t<=T;t++){
        while (!hang.empty() && hang.top().w==t){
            i=hang.top().i; hang.pop();
            wait.push(node(i,t+L[i])); b[i]=1;
            if (!in[i]){
                Q.push(i); in[i]=1;
            }
        }
        while (!dial.empty() && dial.top().w==t){
            b[dial.top().i]=3; dial.pop(); ++rest;
        }
        while (!Q.empty() && rest){
            i=Q.top(); Q.pop(); in[i]=0;
            if (b[i]!=1) continue;
            b[i]=2; dial.push(node(i,t+M[i]));  --rest;
        }
        while (!wait.empty() && wait.top().w==t){
            i=wait.top().i; wait.pop(); 
            if (b[i]==1){
                b[i]=0; hang.push(node(i,t+K[i]));
                if (t+K[i]+W[i]>T) return 0;
            }
        }
    }
    for (i=1;i<=N;i++){
        if (b[i]<3) return 0;
    }
    return 1;
}

int main(){
    while (scanf("%d%d",&N,&T),N | T){
        int i;
        for (i=1;i<=N;i++){
            scanf("%d%d%d",&M[i],&L[i],&K[i]);
        }
        for (i=1;i<=N;i++)
            if (gao(i)) break;
        printf("%d\n",i);
    }       
}   

Compiler output:
a.cc: In function 'bool gao(int)':
a.cc:64:28: error: 'W' was not declared in this scope
   64 |                 if (t+K[i]+W[i]>T) return 0;
      |                            ^
Language: C++

#include "iostream"
#include "cstring"
#include "cstdio"
#include "vector"
using namespace std;
const int N = 2010;
int vis[N], M[N], L[N], K[N], v[N];
int n, T;
bool gao(int x)
{
	memset(v, 0, sizeof(v));
	memset(vis, 0, sizeof(vis));
	v[0] = x;
	for(int i = 0; i <= T; ++ i){
		if(i != 0) v[i] += v[i - 1];
		for(int j = 1; j <= n; ++ j){
			if(v[i] == 0) break;
			if(vis[j]) continue;
			if(i % (L[j] + K[j]) <= L[j] && i + M[j] <= T){
				v[i] --;
				v[i + M[j]] ++;
				vis[j] = 1;
			}
		}
	}
	for(int i = 1; i <= n; ++ i){
		if(vis[i] == 0) return false;
	}
	return true;
}
				
int main(void)
{
	while(scanf("%d %d", &n, &T) && (n || T)){
		for(int i = 1; i <= n; ++ i){
			scanf("%d %d %d", &M[i], &L[i], &K[i]);
		}
		for(int i = 1; i <= n; ++ i){
			if(gao(i)){
				cout << l << endl;
				break;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:41: error: 'l' was not declared in this scope
   40 |                                 cout << l << endl;
      |                                         ^
Language: C

#include<iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<sstream>
//#include<ctype.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;

const int inf = 0x3f3f3f3f;
const double eps = 1e-8;
const int maxn = 1e4+5;
const ll mod = 1e9+7;

int n, m, k;
vector<int> G[maxn];
int match[maxn];		//匹配 
bool used[maxn];
int mp[maxn][maxn];
vector<Pii> q;

//?算任意?点?的最短距? 
void floyd(){
    for(int l = 0; l < n;l++){
        for(int i = 0;i < n;i++){
            for(int j = 0;j < n;j++)
                mp[i][j] = min(mp[i][j], mp[i][l] + mp[l][j]);
        }
    }
}


void addedge(int u, int v){
	G[u].push_back(v);
	G[v].push_back(u);
}

//dfs?找?广路 
bool dfs(int v){
	used[v] = true;
	for(int i=0; i<G[v].size(); i++){
		int u = G[v][i], w = match[u];
		if(w<0 || !used[w] && dfs(w)){	//u未匹配?，或?有?广路 
			match[v] = u;
			match[u] = v;
			return true;
		}
	}
	return false;
}

//求解二分?的最大匹配 
int bipartite_matching(){
	int res = 0;
	memset(match, -1, sizeof(match));
	for(int v = 0; v<n+k; v++){
		if(match[v] < 0){
			memset(used, 0, sizeof(used));
			if(dfs(v)){
				res++;
			}
		}
	} 
	return res;
}

//建?，到?一点后?能到?的点?? 
void build(){
    for(int i = 0;i < q.size();i++){
        for(int j = 0; j < q.size(); j++){
            if(i == j) continue;
            Pii a = q[i], b = q[j];
            int tmp = b.second - a.second;
            if(tmp >= mp[a.first][b.first]){
            	addedge(i, j+k);
            }
        }
    }
}


int main(){
	while(scanf("%d%d%d", &n, &m, &k) == 3 &&(n||k||m)){
		q.clear();
		for(int i = 0;i < 2*n;i++){
	        for(int j = 0;j < 2*n;j++){
	            if(i == j) mp[i][j] = 0;
	            else mp[i][j] = inf;
	        }
    	}
    	
		for(int i=0; i<n+k; i++){
			G[i].clear();
		}
		 
		for(int i = 0;i < m;i++){
            int u, v, w;
            scanf("%d%d%d",&u,&v,&w);
            mp[u][v] = w;
            mp[v][u] = w;
        }
        
        for(int i = 0;i < k;i++){
            int a,b;
            scanf("%d%d",&a,&b);
            q.push_back(make_pair(a,b));
        }
        
        floyd();
		build();
		
		printf("%d\n", k-bipartite_matching());
	}
	return 0;
} 

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

#include <cstdio>
#include <string.h>
#define INF 99999999
using namespace std;

typedef struct {
    int num;
    int time;
}node;
int n,l;
int dis[105][105],w[1005][1005];
int linker[1005],vis[1005];
node no[1005];

void floyd() {
    for(int k = 0;k < n;k++)
        for(int i = 0;i < n;i++)
            for(int j = 0;j < n;j++)
                if(dis[i][k] < INF &&
                   dis[k][j] < INF &&
                   dis[i][j] > dis[i][k] + dis[k][j])
                   dis[i][j] = dis[i][k] + dis[k][j];
}

bool dfs(int u) {
    for(int v = 1;v <= l;v++)
        if(w[u][v] && !vis[v]) {
            vis[v] = 1;
            if(linker[v] == -1 || dfs(linker[v])) {
                linker[v] = u;
                return true;
            }
        }
    return false;
}

int hungary() {
    int res = 0;
    memset(linker,-1,sizeof(linker));
    for(int u = 1;u <= l;u++) {
        memset(vis,0,sizeof(vis));
        if(dfs(u)) res++;
    }
    return res;
}

int main() {
    int m;
    //freopen("test.in","r",stdin);
    while(~scanf("%d%d%d",&n,&m,&l) && (n + m + l)) {
        memset(w,0,sizeof(w));
        for(int i = 0;i < n;i++)
            for(int j = 0;j < n;j++) {
                dis[i][j] = INF;
                if(i == j) dis[i][j] = 0;
            }


        while(m--) {
            int a,b,val;
            scanf("%d%d%d",&a,&b,&val);
            dis[a][b] = val;
            dis[b][a] = val;
        }

        floyd();

        for(int i = 1;i <= l;i++)
            scanf("%d%d",&no[i].num,&no[i].time);

        for(int i = 1;i <= l;i++)
            for(int j = 1;j <= l;j++) {
            if(i == j) continue;
            int f = no[i].num,t = no[j].num;
            int ft = no[i].time,tt = no[j].time;
            if(ft + dis[f][t] <= tt) w[i][j] = 1;
        }

        printf("%d\n",l - hungary());
    }
    return 0;
}

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

#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <functional>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
typedef long long ll;
const int MAX_V=2000;
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
void add_edge(int u,int v){
	G[u].push_back(v);
	G[v].push_back(u);
}
bool dfs(int v){
	used[v]=true;
	rep(i,G[v].size()){
		int u=G[v][i],w=match[u];
		if(w<0 || (!used[w] && dfs(w))){
			match[v]=u;
			match[u]=v;
			return true;
		}
	}
	return false;
}
int nibu(){
	int res=0;
	memset(match,-1,sizeof(match));
	rep(v,V){
		if(match[v]<0){
			memset(used,0,sizeof(used));
			if(dfs(v)) res++;
		}
	}
	return res;
}
int N,M,L,INF=1e9;
ll d[100][100];
int p[1000],t[1000];
int main(){
	while(true){
		cin>>N>>M>>L;
		if(N==0) break;
		rep(i,N) rep(j,N) if(i!=j) d[i][j]=INF;
		rep(i,M){
			int u,v,di;
			cin>>u>>v>>di;
			d[u][v]=di;
			d[v][u]=di;
		}
		rep(i,N) rep(j,N) rep(k,N) d[j][k]=min(d[j][k],d[j][i]+d[i][k]);
		rep(i,L) cin>>p[i]>>t[i];
		V=2*L;
		rep(i,V) G[i].clear();
		rep(i,L) rep(j,L) if(i!=j){
			if(t[i]+d[p[i]][p[j]]<=t[j]){
				add_edge(i,j+L);
			}
		}
		cout<<L-nibu()<<endl;
	}
}

Compiler output:
a.cc: In function 'int nibu()':
a.cc:40:9: error: 'memset' was not declared in this scope
   40 |         memset(match,-1,sizeof(match));
      |         ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <functional>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
#define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x)
template <class T> bool setmin(T & l, T const & r) { if (not (r < l)) return false; l = r; return true; }
using namespace std;
template <typename T, typename X> auto vectors(T a, X x) { return vector<T>(x, a); }
template <typename T, typename X, typename Y, typename... Zs> auto vectors(T a, X x, Y y, Zs... zs) { auto cont = vectors(a, y, zs...); return vector<decltype(cont)>(x, cont); }
template <class T> ostream & operator , (ostream & out, T a) { return out << a; }

const int inf = 1e9+7;
int main() {
    while (true) {
        // input
        int n, m, l; cin >> n >> m >> l;
        if (n == 0 and m == 0 and l == 0) break;
        vector<map<int,int> > g(n);
        repeat (i,m) {
            int u, v, d; cin >> u >> v >> d;
            g[u][v] = d;
            g[v][u] = d;
        }
        vector<int> p(l), t(l);
        repeat (i,l) cin >> p[i] >> t[i];
        // warshall floyd
        vector<vector<int> > dist = vectors(inf, n, n);
        repeat (i,n) dist[i][i] = 0;
        repeat (i,n) for (auto it : g[i]) dist[i][it.first] = it.second;
        repeat (k,n) repeat (i,n) repeat (j,n) setmin(dist[i][j], dist[i][k] + dist[k][j]);
        // make a digraph of presents
        vector<set<int> > h(l);
        repeat (i,l) repeat (j,l) if (dist[p[i]][p[j]] <= t[j] - t[i]) h[i].insert(j);
        vector<set<int> > rev(l);
        repeat (i,l) for (int j : h[i]) rev[j].insert(i);
        // run on the DAG
        vector<int> que(l);
        whole(iota, que, 0);
        whole(sort, que, [&](int i, int j) { return t[i] < t[j]; });
        vector<bool> has_santa(l);
        int ans = 0;
        for (int i : que) {
            for (int j : rev[i]) if (has_santa[j]) {
                has_santa[j] = false;
                has_santa[i] = true;
                break;
            }
            if (not has_santa[i]) {
                has_santa[i] = true;
                ans += 1;
            }
        }
        // output
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:40:15: error: 'iota' was not declared in this scope
   40 |         whole(iota, que, 0);
      |               ^~~~
a.cc:7:56: note: in definition of macro 'whole'
    7 | #define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x)
      |                                                        ^
Language: C++

#include <iostream>
#include <vector>
#include <utility>
using namespace std;
const int INF = 1e9;

void dfs(vector< vector<int> > &G, vector<bool> &visited, int v){
  visited[v] = true;
  for(int i = 0; i < G[v].size(); ++i){
    if(visited[G[v][i]]) continue;
    dfs(G, visited, G[v][i]);
    break;
  }
}

int main(){
  int N, M, L;
  while(cin >> N >> M >> L, N){
    vector< vector<int> > D(N, vector<int>(N, INF));
    for(int i = 0; i < M; ++i){
      int u, v, d;
      cin >> u >> v >> d;
      D[u][v] = d;
      D[v][u] = d;
    }
    for(int i = 0; i < N; ++i) D[i][i] = 0;
    for(int k = 0; k < N; ++k){
      for(int i = 0; i < N; ++i){
        for(int j = 0; j < N; ++j){
          D[i][j] = min(D[i][j], D[i][k] + D[k][j]);
        }
      }
    }
    vector< pair<int,int> > V;
    for(int i = 0; i < L; ++i){
      int p, t;
      cin >> p >> t;
      V.emplace_back(t, p);
    }
    sort(V.begin(), V.end());
    vector< vector<int> > G(L);
    for(int i = 0; i < L; ++i){
      for(int j = 0; j < i; ++j){
        int p_i = V[i].second, t_i = V[i].first, p_j = V[j].second, t_j = V[j].first;
        if(D[p_i][p_j] <= t_i - t_j) G[j].push_back(i);
      }
    }
    vector<bool> visited(L, false);
    int ans = 0;
    for(int i = 0; i < L; ++i){
      if(visited[i]) continue;
      ++ans;
      dfs(G, visited, i);
    }
    cout << ans << endl;
  }
  return 0;
}



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

#include<iostream>
#include<vector>

#define MAX_V 1001
#define INF 100000000

void add_edge(int,int);
bool dfs(int);
int bipartite_matching(int);
void warshall_floyd(int);

using namespace std;

vector<int>G[MAX_V];
bool used[MAX_V];
int match[MAX_V],d[MAX_V][MAX_V];



int main(void){
  int n,m,l,p[MAX_V],t[MAX_V];

  while(scanf("%d %d %d",&n,&m,&l),n,m,l){
    for(int i=0;i<MAX_V*2;i++)G[i].clear();
      for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	  d[i][j]= i==j ?0:INF;

      for(int i=0;i<m;i++){
	  int a,b,c; 
	  scanf("%d %d %d",&a,&b,&c);
	  d[a][b]=d[b][a]=c;
	}
      warshall_floyd(n);

      for(int i=0;i<l;i++)
	scanf("%d %d",&p[i],&t[i]);

      for(int i=0;i<l;i++){
	for(int j=0;j<l;j++){
	  if(i==j)continue;
	  else if(t[i]+d[p[i]][p[j]]<=t[j])
	    add_edge(i,j+l);
	}
      }

      cout << l-bipartite_matching(2*l) << endl;
    }
  return 0;
}

void add_edge(int u,int v){
  G[u].push_back(v);
  G[v].push_back(u);
}

bool dfs(int v){
  used[v]=true;
  for(int i=0;i < G[v].size();i++){
    int u= G[v][i],w=match[u];
    if(w < 0 || !used[w] && dfs(w)){
      match[v]=u;
      match[u]=v;
      return true;
    }
  }
  return false;
}


int bipartite_matching(int V){
  int res = 0;
  memset(match,-1,sizeof(match));
  for(int v=0; v<V; v++){
    if(match[v]<0){
      memset(used, 0, sizeof(used));
      if(dfs(v))res++;
    }
  }
  return res;
}

void warshall_floyd(int V){
  for(int i = 0; i < V; i++){
    for(int j = 0; j < V; j++){
      for(int k = 0; k < V; k++){
	d[j][k]=min(d[j][k],d[j][i]+d[i][k]);
      }
    }
  }
}

Compiler output:
a.cc: In function 'int bipartite_matching(int)':
a.cc:73:3: error: 'memset' was not declared in this scope
   73 |   memset(match,-1,sizeof(match));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<vector>
  +++ |+#include <cstring>
    3 |
Language: C++

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


vector<int> gra[1005];
int dis[105][105];
int lin[1005][2];
int n,m,l;
int p[1005];
bool vis[1005];
bool find(int x)
{
    for(int i=0;i<gra[x].size();i++)
        if(vis[gra[x][i]]==0)
        {
            vis[gra[x][i]]=1;
            if(p[gra[x][i]]==0 || find(p[gra[x][i]]))
            {
                p[gra[x][i]]=x;
                return 1;
            }
        }
    return 0;
}
int max_match()
{
    memset(p,0,sizeof(p));
    int ans=0;
    for(int i=1;i<=l;i++)
    {
        memset(vis,0,sizeof(vis));
        ans+=find(i);
    }
    return ans;
}
int main()
{
    while(scanf("%d%d%d",&n,&m,&l))
    {
        if(n==0 && m==0 && l==0) break;
        int x,y,w;
        for(int i=0;i<n;i++)
            for(int j=0;j<n;j++)
                if(i==j) dis[i][j]=0;
                else dis[i][j]=0x3fffffff;
        for(int i=0;i<m;i++)
        {
            scanf("%d%d%d",&x,&y,&w);
            dis[y][x]=dis[x][y]=min(dis[x][y],w);
        }
        for(int k=0;k<n;k++)
            for(int i=0;i<n;i++)
                for(int j=0;j<n;j++)
                    dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
        for(int i=0;i<l;i++)
            scanf("%d%d",&lin[i][0],&lin[i][1]);
        for(int i=0;i<=l;i++) gra[i].clear();
        for(int i=0;i<l;i++)
            for(int j=0;j<l;j++)
                if(i!=j)
                {
                    if(dis[lin[i][0]][lin[j][0]]<=lin[i][1]-lin[j][1])
                        gra[j+1].push_back(i+1);
                }
        printf("%d\n",l-max_match());
    }
    return 0;
}

Compiler output:
a.cc: In function 'int max_match()':
a.cc:29:5: error: 'memset' was not declared in this scope
   29 |     memset(p,0,sizeof(p));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<vector>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

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

int dfs(int s, int *v, int *pa, vector<int> *dag){
  if(s<0)return 1;
  rep(i,dag[s].size()){
    if(!v[dag[s][i]]){
      v[dag[s][i]]=1;
      if(dfs(pa[dag[s][i]],v,pa,dag)){
	pa[s]=dag[s][i],pa[dag[s][i]]=s;
	return 1;
      }
    }
  }
  return 0;
}

int main(){
  int N,M,L;
  
  while(cin>>N>>M>>L,N){
    int d[N][N];
    memset(d,INT_MAX,sizeof(d));
    rep(i,N)d[i][i]=0;

    rep(i,M){
      int u,v,w; cin>>u>>v>>w;
      d[u][v]=w;d[v][u]=w;
    }

    int p[L], t[L];
    rep(i,L)cin>>p[i]>>t[i];
  
    // calc shortest path
    rep(i,N)rep(j,N)rep(k,N)d[i][j]=(d[i][j]>d[i][k]+d[k][j])?d[i][k]+d[k][j]:d[i][j];
    // calc DAG
    vector<int> dag[N];
    rep(i,L)rep(j,L){if(i!=j && d[p[i]][p[j]]<=t[j]-t[i])dag[p[i]].push_back(p[j]),dag[p[j]].push_back(p[i]);}
    // enumerate santas
    int num=L;
    int pa[L];memset(pa,-1,sizeof(pa));
    rep(i,L){
      int v[N];memset(v,0,sizeof(v));
      if(dfs(p[i],v,pa,dag))num--;
    }
    cout<<num<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'INT_MAX' was not declared in this scope
   26 |     memset(d,INT_MAX,sizeof(d));
      |              ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <cstring>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

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

int dfs(int s, int *v, int *pa, vector<int> *dag){
  if(s<0)return 1;
  rep(i,dag[s].size()){
    if(!v[dag[s][i]]){
      v[dag[s][i]]=1;
      if(dfs(pa[dag[s][i]],v,pa,dag)){
	pa[s]=dag[s][i],pa[dag[s][i]]=s;
	return 1;
      }
    }
  }
  return 0;
}

int main(){
  int N,M,L;
  
  while(cin>>N>>M>>L,N){
    int d[N][N];
    memset(d,INT_MAX,sizeof(d));
    rep(i,N)d[i][i]=0;

    rep(i,M){
      int u,v,w; cin>>u>>v>>w;
      d[u][v]=w;d[v][u]=w;
    }

    int p[L], t[L];
    rep(i,L)cin>>p[i]>>t[i];
  
    // calc shortest path
    rep(i,N)rep(j,N)rep(k,N)d[i][j]=(d[i][j]>d[i][k]+d[k][j])?d[i][k]+d[k][j]:d[i][j];
    // calc DAG
    vector<int> dag[N];
    rep(i,L)rep(j,L){if(i!=j && d[p[i]][p[j]]<=t[j]-t[i])dag[p[i]].push_back(p[j]),dag[p[j]].push_back(p[i]);}
    // enumerate santas
    int num=L;
    int pa[L];memset(pa,-1,sizeof(pa));
    rep(i,L){
      int v[N];memset(v,0,sizeof(v));
      if(dfs(p[i],v,pa,dag))num--;
    }
    cout<<num<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: 'INT_MAX' was not declared in this scope
   27 |     memset(d,INT_MAX,sizeof(d));
      |              ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <cstring>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
#include <cstring>
#include <limits>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int dfs(int s, int *v, int *pa, vector<int> *dag){
  if(s<0)return 1;
  rep(i,dag[s].size()){
    if(!v[dag[s][i]]){
      v[dag[s][i]]=1;
      if(dfs(pa[dag[s][i]],v,pa,dag)){
        pa[s]=dag[s][i],pa[dag[s][i]]=s;
        return 1;
      }
    }
  }
  return 0;
}

int main(){
  int N,M,L;
  while(cin>>N>>M>>L,N){
    int d[N][N];
    rep(i,N)rep(j,N)d[i][j]=(INT_MAX-1)/2;
    rep(i,N)d[i][i]=0;
    rep(i,M){
      int u,v,w; cin>>u>>v>>w;
      d[u][v]=w;d[v][u]=w;
    }

    int p[L],t[L];
    rep(i,L)cin>>p[i]>>t[i];
    rep(k,N)rep(i,N)rep(j,N)d[i][j]=(d[i][j]>d[i][k]+d[k][j])?(d[i][k]+d[k][j]):d[i][j];
    vector<int> dag[L];
    rep(i,L)rep(j,L){if(i!=j && d[p[i]][p[j]]<=t[j]-t[i])dag[i].push_back(j);}

    int num=L;
    int pa[L]; memset(pa,-1,sizeof(pa));
    rep(i,L){
      int v[L]; memset(v,0,sizeof(v));
      if(dfs(i,v,pa,dag)){num--;}
    }
    cout<<num<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: 'INT_MAX' was not declared in this scope
   26 |     rep(i,N)rep(j,N)d[i][j]=(INT_MAX-1)/2;
      |                              ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <limits>
  +++ |+#include <climits>
    5 | using namespace std;
Language: Java

public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String args[]){
        int count;
        boolean left;
        String line;
        char[] tmp;
        Character[] qwert = {'q','w','e','r','t',
                             'a','s','d','f','g',
                             'z','x','c','v','b'};
        Character[] yuiop = {'y','u','i','o','p',
                             'h','j','k','l',
                             'n','m'};
        while(!(line = sc.next()).equals("#")){
            count = 0;
            tmp = line.toCharArray();
            left = Arrays.asList(qwert).contains(tmp[0]);
            for(int i = 1; i < tmp.length; i++){
                if(Arrays.asList(qwert).contains(tmp[i])){
                    if(!left){
                        left = true;
                        count++;
                    }
                }else{
                    if(left){
                        left = false;
                        count++;
                    }
                }
            }
            System.out.println(count);
        }
    }
}

Compiler output:
Main.java:2: error: cannot find symbol
    static Scanner sc = new Scanner(System.in);
           ^
  symbol:   class Scanner
  location: class Main
Main.java:2: error: cannot find symbol
    static Scanner sc = new Scanner(System.in);
                            ^
  symbol:   class Scanner
  location: class Main
Main.java:18: error: cannot find symbol
            left = Arrays.asList(qwert).contains(tmp[0]);
                   ^
  symbol:   variable Arrays
  location: class Main
Main.java:20: error: cannot find symbol
                if(Arrays.asList(qwert).contains(tmp[i])){
                   ^
  symbol:   variable Arrays
  location: class Main
4 errors
Language: C

int main(){

	int len;
	char migi[N] = "yuiophjklnm";
	char input[128];
	int cnt;
	int flag,a_flag;
	int flag2;
	int i,j;

	while(1){

		cnt = 0;
		flag2 = 0;

		scanf("%s",input);
		len = strlen(input);


		if(input[0] == '#' ){
			break;
		}
		for(i=0; i<len; i++){
			for(j=0; j<N; j++){
				if(input[i] == migi[j]){
					flag = 1;
					break;
				}
				else{
					flag = 0;
				}
			}
			if(flag2 == 0){
				flag2 = 1;
				a_flag = flag;
			}

			if(flag != a_flag){
				cnt++;
			}
			a_flag = flag;

		}
		printf("%d\n",cnt);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:19: error: 'N' undeclared (first use in this function)
    4 |         char migi[N] = "yuiophjklnm";
      |                   ^
main.c:4:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   16 |                 scanf("%s",input);
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:16:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   16 |                 scanf("%s",input);
      |                 ^~~~~
main.c:16:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:17:23: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   17 |                 len = strlen(input);
      |                       ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | int main(){
main.c:17:23: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   17 |                 len = strlen(input);
      |                       ^~~~~~
main.c:17:23: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:44:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   44 |                 printf("%d\n",cnt);
      |                 ^~~~~~
main.c:44:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:44:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:44:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <string.h>

#define LEFT_KEYS  ("qwert" "asdfg" "zxcvb")
#define MAXLEN 32

int leftKeyTbl['z' - 'a' + 1];

void initialize()
{
  const char *p;
  for (p = LEFT_KEYS; *p != '\0'; p++) {
    leftKeyTbl[*p - 'a'] = 1;
  }
}

int main()
{
  static char str[MAXLEN + 1];
  int i, prev, now, n;
  initialize();
  for (;;) {
    scanf("%s", str);
    if (strcmp(str, "#") == 0) break;
    prev = isLeftKey(str[0]);
    n = 0;
    for (i = 1; str[i] != '\0'; i++) {
      now = isLeftKey(str[i]);
      if (prev != now) n++;
      prev = now;
    }
    printf("%d\n", n);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:12: error: implicit declaration of function 'isLeftKey' [-Wimplicit-function-declaration]
   25 |     prev = isLeftKey(str[0]);
      |            ^~~~~~~~~