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

#include<iosteram>
#include<fstream>
#include<queue>

using namespace std;
int c[200000];
int a[200000];
int b[200000];
int e[200000];
unsigned long long int d[200000];
unsigned long long int w=0;
int main(){
	queue<int> q1;
	int n=0;
	int m=0;
	int k=0;
	int s=0;
	int p=0;
	int q=0;
	int i=0;
	int j=0;
	int g=0;
	for(i=0;i<200000;i++){
		a[i]=0;
		b[i]=0;
		c[i]=0;
		d[i]=0;
	}
	cin>>n;
	cin>>m;
	cin>>k;
	cin>>s;
	cin>>p;
	cin>>q;
	for(i=0;i<k;i++){
		cin>>c[i];
	}
	for(i=0;i<m;i++){
		cin>>a[i];
		cin>>b[i];
	}
	for(i=0;i<s;i++){
		for(j=0;j<k;j++){
			for(g=0;g<n;g++){
				if(a[g]==c[j] && e[b[g]-1]==0){
					e[b[g]-1]=1;
					q1.push (b[g]);
				}
				if(b[g]==c[j] && e[a[g]-1]==0){
					e[a[g]-1]=1;
					q1.push (a[g]);
				}
			}
		}
		k=q1.size();
		for(j=0;j<k;j++){
			c[j]=q1.front();
			q1.pop();
		}
	}
	g=1;
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(a[j]==g && d[b[j]-1]==0){
				if(e[b[j]-1]==0){
					d[b[j]-1]=d[a[j]-1]+p;
				}else{
					d[b[j]-1]=d[a[j]-1]+q;
				}
				q1.push (b[j])
			}else if(a[j]==g){
				if(e[b[j]-1]==0){
					w=d[a[j]-1]+p;
				}else{
					w=d[a[j]-1]+q;
				}
				if(w<d[b[j]-1]){
					d[b[j]-1]=w;
					q1.push (b[j])
				}
			}
			if(b[j]==g && d[a[j]-1]==0){
				if(e[a[j]-1]==0){
					d[a[j]-1]=d[b[j]-1]+p;
				}else{
					d[a[j]-1]=d[b[j]-1]+q;
				}
				q1.push (a[j])
			}else if(a[j]==g){
				if(e[b[j]-1]==0){
					w=d[a[j]-1]+p;
				}else{
					w=d[a[j]-1]+q;
				}
				if(w<d[b[j]-1]){
					d[b[j]-1]=w;
					q1.push (b[j])
				}
			}
		}
		g=q1.front();
		q1.pop();
	}
	cout<<d[n-1]<<endl;
}

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

#include<iostream>
#include<fstream>
#include<queue>

using namespace std;
int c[200000];
int a[200000];
int b[200000];
int e[200000];
unsigned long long int d[200000];
unsigned long long int w=0;
int main(){
	queue<int> q1;
	int n=0;
	int m=0;
	int k=0;
	int s=0;
	int p=0;
	int q=0;
	int i=0;
	int j=0;
	int g=0;
	for(i=0;i<200000;i++){
		a[i]=0;
		b[i]=0;
		c[i]=0;
		d[i]=0;
	}
	cin>>n;
	cin>>m;
	cin>>k;
	cin>>s;
	cin>>p;
	cin>>q;
	for(i=0;i<k;i++){
		cin>>c[i];
	}
	for(i=0;i<m;i++){
		cin>>a[i];
		cin>>b[i];
	}
	for(i=0;i<s;i++){
		for(j=0;j<k;j++){
			for(g=0;g<n;g++){
				if(a[g]==c[j] && e[b[g]-1]==0){
					e[b[g]-1]=1;
					q1.push (b[g]);
				}
				if(b[g]==c[j] && e[a[g]-1]==0){
					e[a[g]-1]=1;
					q1.push (a[g]);
				}
			}
		}
		k=q1.size();
		for(j=0;j<k;j++){
			c[j]=q1.front();
			q1.pop();
		}
	}
	g=1;
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(a[j]==g && d[b[j]-1]==0){
				if(e[b[j]-1]==0){
					d[b[j]-1]=d[a[j]-1]+p;
				}else{
					d[b[j]-1]=d[a[j]-1]+q;
				}
				q1.push (b[j])
			}else if(a[j]==g){
				if(e[b[j]-1]==0){
					w=d[a[j]-1]+p;
				}else{
					w=d[a[j]-1]+q;
				}
				if(w<d[b[j]-1]){
					d[b[j]-1]=w;
					q1.push (b[j])
				}
			}
			if(b[j]==g && d[a[j]-1]==0){
				if(e[a[j]-1]==0){
					d[a[j]-1]=d[b[j]-1]+p;
				}else{
					d[a[j]-1]=d[b[j]-1]+q;
				}
				q1.push (a[j])
			}else if(a[j]==g){
				if(e[b[j]-1]==0){
					w=d[a[j]-1]+p;
				}else{
					w=d[a[j]-1]+q;
				}
				if(w<d[b[j]-1]){
					d[b[j]-1]=w;
					q1.push (b[j])
				}
			}
		}
		g=q1.front();
		q1.pop();
	}
	cout<<d[n-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:47: error: expected ';' before '}' token
   70 |                                 q1.push (b[j])
      |                                               ^
      |                                               ;
   71 |                         }else if(a[j]==g){
      |                         ~                      
a.cc:79:55: error: expected ';' before '}' token
   79 |                                         q1.push (b[j])
      |                                                       ^
      |                                                       ;
   80 |                                 }
      |                                 ~                      
a.cc:88:47: error: expected ';' before '}' token
   88 |                                 q1.push (a[j])
      |                                               ^
      |                                               ;
   89 |                         }else if(a[j]==g){
      |                         ~                      
a.cc:97:55: error: expected ';' before '}' token
   97 |                                         q1.push (b[j])
      |                                                       ^
      |                                                       ;
   98 |                                 }
      |                                 ~
Language: C++

#include "iostream"
#include "climits"
#include "list"
#include "queue"
using namespace std;

int N, M, K, S;
int status[131073];
int price[2];
int dead;
long long int now;
int box, bag;
list<int> to[100001];
long long int dis[131073];
bool flag[131073];
queue<int>Q;
priority_queue<int> town;

long long int RMQ(int left, int right) {
	if (left == right) {
		if (flag[left])return dis[left];
		else return INT64_MAX;
	}
	return min(RMQ(left, (left + right) / 2), RMQ((left + right) / 2 + 1, right));
}

int main() {
	cin >> N >> M >> K >> S;
	cin >> price[0] >> price[1];
	for (int i = 1; i <= N; i++) {
		flag[i] = true;
	}
	for (int i = 0; i < K; i++) {
		cin >> box;
		status[box] = -1;
		flag[box] = false;
	}
	for (int i = 0; i < M; i++) {
		cin >> box >> bag;
		to[box].push_back(bag);
		to[bag].push_back(box);
	}
	for (int i = 2; i < N; i++) {
		if (status[i] == 0) {
			Q.push(i);
			for (int j = 1; j <= N; j++) {
				dis[j] = INT_MAX;
			}
			dis[i] = 0;
			while (!Q.empty()) {
				for (auto j = to[Q.front()].begin(); j != to[Q.front()].end(); ++j) {
					if (dis[Q.front()] + 1 < dis[(*j)]) {
						dis[(*j)] = dis[Q.front()] + 1;
						if (dis[(*j)] > S) {
							while (!Q.empty()) {
								Q.pop();
							}
							break;
						}
						if (status[(*j)] == -1) {
							status[i] = 1;
							while (!Q.empty()) {
								Q.pop();
							}
							break;
						}
						Q.push((*j));
					}
				}
				if (Q.empty())break;
				Q.pop();
			}
		}
	}
	dis[1] = 1;
	for (int i = 2; i <= N; i++) {
		dis[i] = INT64_MAX;
	}
	while (1) {
		now = RMQ(1, N) % 200000;
		flag[now] = false;
		if (now == N) break;
		for (auto i = to[now].begin(); i != to[now].end(); ++i) {
			if (flag[(*i)]) {
				if (dis[now] / 200000 + price[status[(*i)]] < dis[(*i)] / 200000) {
					dis[(*i)] = (dis[now] / 200000 + price[status[(*i)]]) * 200000 + (*i);
				}
			}
		}
	}
	cout << dis[N] / 200000-price[status[N]] << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'long long int RMQ(int, int)':
a.cc:22:29: error: 'INT64_MAX' was not declared in this scope
   22 |                 else return INT64_MAX;
      |                             ^~~~~~~~~
a.cc:5:1: note: 'INT64_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    4 | #include "queue"
  +++ |+#include <cstdint>
    5 | using namespace std;
a.cc: In function 'int main()':
a.cc:77:26: error: 'INT64_MAX' was not declared in this scope
   77 |                 dis[i] = INT64_MAX;
      |                          ^~~~~~~~~
a.cc:77:26: note: 'INT64_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
#include <string.h>
#define F first
#define S second
#define MP make_pair
#define int long long
#define INF long(1e18)
using namespace std;
typedef pair<int, int> P;
typedef pair<P, int> PP;


int n, m, k, s, pp, q, ans[100001];
int dead[100001];
vector<int> road[100001], root;
void bfs(int sta)
{
  queue<P> que;
  que.push(MP(sta, 0));
  dead[sta] = -1;
  while(!que.empty())
  {
    P p = que.front();
    que.pop();
    if(p.S == s) continue;
    for(int i = 0; i < road[p.F].size(); i++)
    {
      if(!dead[p.F][i] || dead[road[p.F][i]] > p.S + 1)
      {
        que.push(MP(road[p.F][i], p.S + 1));
        dead[road[p.F][i]] = p.S + 1;
      }
    }
  }
}
void dijkstra(){
  priority_queue<P> pq;
  pq.push(MP(0, 1));
  ans[1] = 0;
  while(!pq.empty())
  {
    P p = pq.top();
    pq.pop();
    for(int i = 0; i < road[p.S].size(); i++)
    {
      if(dead[road[p.S][i]] == -1) continue;
      if(!dead[road[p.S][i]] && ans[road[p.S][i]] < p.F - pp)
      {
        pq.push(MP(p.F - pp, road[p.S][i]));
        ans[road[p.S][i]] = p.F - pp;
      }
      else if(ans[road[p.S][i]] < p.F - q){
        pq.push(MP(p.F - q, road[p.S][i]));
        ans[road[p.S][i]] = p.F - q;
      }
    }
  }
}
signed main()
{
  cin >> n >> m >> k >> s >> pp >> q;
  for(int i = 0; i < k; i++)
  {
    int a;
    cin >> a;
    root.push_back(a);
  }
  for(int i = 0; i < m; i++)
  {
    int a, b;
    cin >> a >> b;
    road[a].push_back(b);
    road[b].push_back(a);
  }
  for(int i = 0; i < k; i++)
  {
    bfs(root[i]);
  }
  fill(ans, ans + n + 1, -INF);
  dijkstra();
  if(!dead[n])
    cout << -ans[n] - pp << endl;
  else
    cout << -ans[n] - q <<endl;
}

Compiler output:
a.cc: In function 'void bfs(long long int)':
a.cc:32:20: error: invalid types 'long long int[long long int]' for array subscript
   32 |       if(!dead[p.F][i] || dead[road[p.F][i]] > p.S + 1)
      |                    ^
Language: C++

#include <cstdio>
#include <queue>
#include <vector>
#define MAX_N 100001
#define P pair<int, int>
#define PB push_back
using namespace std;

const long long int INF = 1000000000000000000;
int n, m, k, s, p, q, c[MAX_N], r[2];
long long int cost[MAX_N];
bool dead[MAX_N], danger[MAX_N];
vector<int> road[MAX_N];
queue<P> que;
priority_queue<P, vector<P>, greater<P> > p_que;

int price(int x){
	return danger[x] ? q : p;
}

void bfs(int start){
	que.push(P(start, s));
	dead[start] = 1;
	while(!que.empty()){
		P q = que.front();
		que.pop();
		if(q.second >= 1){
			for(int i = 0; i < road[q.first].size(); i++)
				if(!danger[q.first]){
					danger[q.first] = 1;
					que.push(P(road[q.first][i], q.second - 1));
		}
	}
}

void dijkstra(){
	fill(cost, cost + n + 1, INF);
	cost[1] = 0;
	p_que.push(P(1, cost[1]));
	while(!p_que.empty()){
		P pq = p_que.top();
		p_que.pop();
		int v = pq.first;
		if(cost[v] >= pq.second && !dead[v]){
			for(int i = 0; i < road[v].size(); i++){
				if(road[v][i] < n){
					if(cost[road[v][i]] > cost[v] + price(road[v][i])){
						cost[road[v][i]] = cost[v] + price(road[v][i]);
						p_que.push(P(road[v][i], cost[road[v][i]]));
					}
				} else
					cost[road[v][i]] = min(cost[road[v][i]], cost[v]);
			}
		}
	}
}

int main(){
	scanf("%d%d%d%d", &n, &m, &k, &s);
	scanf("%d%d", &p, &q);
	for(int i = 1; i <= k; i++){
		scanf("%d", &c[i]);
	}
	for(int i = 1; i <= m; i++){
		scanf("%d%d", &r[0], &r[1]);
		road[r[0]].PB(r[1]);
		road[r[1]].PB(r[0]);
	}

	for(int i = 1; i <= k; i++)
		bfs(c[i]);

	dijkstra();

	printf("%lld\n", cost[n]);

	return 0;
}

Compiler output:
a.cc: In function 'void bfs(int)':
a.cc:36:16: error: a function-definition is not allowed here before '{' token
   36 | void dijkstra(){
      |                ^
a.cc:58:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   58 | int main(){
      |         ^~
a.cc:58:9: note: remove parentheses to default-initialize a variable
   58 | int main(){
      |         ^~
      |         --
a.cc:58:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:58:11: error: a function-definition is not allowed here before '{' token
   58 | int main(){
      |           ^
a.cc:78:2: error: expected '}' at end of input
   78 | }
      |  ^
a.cc:21:20: note: to match this '{'
   21 | void bfs(int start){
      |                    ^
Language: C++

#include <cstdio>
#include <queue>
#include <vector>
#define MAX_N 100001
#define P pair<int, int>
#define PB push_back
using namespace std;

const long long int INF = 1000000000000000000;
int n, m, k, s, p, q, c[MAX_N], r[2];
long long int cost[MAX_N];
int danger[MAX_N];
vector<int> road[MAX_N];
queue<P> que;
priority_queue<P, vector<P>, greater<P> > p_que;

int price(int x){
	return danger[x] ? q : p;
}

void bfs(int start){
	que.push(P(start, s));
	danger[start] = -1;
	while(!que.empty()){
		P q = que.front();
		que.pop();
		if(q.second >= 1){
			for(int i = 0; i < road[q.first].size(); i++)
				if(!danger[q.first] || danger[q.first] < q.second - 1)
					danger[q.first] = q.second - 1;
					que.push(P(road[q.first][i], q.second - 1));
		}
	}
}

void dijkstra(){
	fill(cost, cost + n + 1, INF);
	cost[1] = 0;
	p_que.push(P(1, cost[1]));
	while(!p_que.empty()){
		P pq = p_que.top();
		p_que.pop();
		int v = pq.first;
		if(cost[v] >= pq.second && danger[v] != -1){
			for(int i = 0; i < road[v].size(); i++){
				if(road[v][i] < n){
					if(cost[road[v][i]] > cost[v] + price(road[v][i])){
						cost[road[v][i]] = cost[v] + price(road[v][i]);
						p_que.push(P(road[v][i], cost[road[v][i]]));
					}
				} else
					cost[road[v][i]] = min(cost[road[v][i]], cost[v]);
			}
		}
	}
}

int main(){
	scanf("%d%d%d%d", &n, &m, &k, &s);
	scanf("%d%d", &p, &q);
	for(int i = 1; i <= k; i++){
		scanf("%d", &c[i]);
	}
	for(int i = 1; i <= m; i++){
		scanf("%d%d", &r[0], &r[1]);
		road[r[0]].PB(r[1]);
		road[r[1]].PB(r[0]);
	}

	for(int i = 1; i <= k; i++)
		bfs(c[i]);

	dijkstra();

	printf("%lld\n", cost[n]);

	return 0;
}

Compiler output:
a.cc: In function 'void bfs(int)':
a.cc:31:66: error: 'i' was not declared in this scope
   31 |                                         que.push(P(road[q.first][i], q.second - 1));
      |                                                                  ^
Language: C++

#include <cstdio>
#include <queue>
#include <vector>
#define MAX_N 100001
#define P pair<int, int>
#define PB push_back
using namespace std;

const long long int INF = 1000000000000000000;
int n, m, k, s, p, q, c[MAX_N], r[2];
long long int cost[MAX_N];
int danger[MAX_N];
vector<int> road[MAX_N];
queue<P> que;
priority_queue<P, vector<P>, greater<P> > p_que;

int price(int x){
	return danger[x] ? q : p;
}

void bfs(int start){
	que.push(P(start, s));
	danger[start] = -1;
	while(!que.empty()){
		P q = que.front();
		que.pop();
		if(q.second >= 1){
			for(int i = 0; i < road[q.first].size(); i++){
				if(!danger[road[q.first][i]] || danger[road[q.first][i]] < q.second - 1){
					danger[road[q.first[i]]] = q.second - 1;
					que.push(P(road[q.first][i], q.second - 1));
				}
			}
		}
	}
}

void dijkstra(){
	fill(cost, cost + n + 1, INF);
	cost[1] = 0;
	p_que.push(P(1, cost[1]));
	while(!p_que.empty()){
		P pq = p_que.top();
		p_que.pop();
		int v = pq.first;
		if(cost[v] >= pq.second && danger[v] != -1){
			for(int i = 0; i < road[v].size(); i++){
				if(road[v][i] < n){
					if(cost[road[v][i]] > cost[v] + price(road[v][i])){
						cost[road[v][i]] = cost[v] + price(road[v][i]);
						p_que.push(P(road[v][i], cost[road[v][i]]));
					}
				} else
					cost[road[v][i]] = min(cost[road[v][i]], cost[v]);
			}
		}
	}
}

int main(){
	scanf("%d%d%d%d", &n, &m, &k, &s);
	scanf("%d%d", &p, &q);
	for(int i = 1; i <= k; i++){
		scanf("%d", &c[i]);
	}
	for(int i = 1; i <= m; i++){
		scanf("%d%d", &r[0], &r[1]);
		road[r[0]].PB(r[1]);
		road[r[1]].PB(r[0]);
	}

	for(int i = 1; i <= k; i++)
		bfs(c[i]);

	dijkstra();

	printf("%lld\n", cost[n]);

	return 0;
}

Compiler output:
a.cc: In function 'void bfs(int)':
a.cc:30:60: error: invalid types 'int[int]' for array subscript
   30 |                                         danger[road[q.first[i]]] = q.second - 1;
      |                                                            ^
Language: C++

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

int a, b;
int c[1000][1000];
bool d[1000][1000];//1 ?????£?????????
int dp[1000][1000][16];//1 ?????£???
int dx[4] = {-1,0,1,1}, dy[4] = {1,1,0,-1};
int ex[4]={-1,0,0,1},ey[4]={0,-1,1,0};
void decide(int x, int y, int z) {//z ????????§????????????
	if (d[x][y])z += c[x][y];
	bool t = true;
	for (int i = 0; i < 4; i++) {
		if (x + ex[i] >= 0 && x + ex[i] < a&&y + ey[i] >= 0 && y + ey[i] < b&&d[x + ex[i]][y + ey[i]]) {
			t = false;
			int o = z, bit = 0;
			int n[4], m[4], sum = 0;
			for (int j = 0; j < 4; j++) {
				if (i == j)continue;
				int xx = x + ex[j], yy = y + ey[j];
				if (xx >= 0 && xx < a&&yy >= 0 && yy < b&&d[xx][yy]) {
					o += c[xx][yy];
					d[xx][yy] = false;
					n[sum] = xx; m[sum] = yy;
					sum++;
				}
			}
			for (int j = 0; j < 4; j++) {
				int xx = x + dx[j], yy = y + dy[j];
				if (xx >= 0 && xx < a&&yy >= 0 && yy < b) {
					if (!d[xx][yy] && c[xx][yy]!=0) {
						bit |= (1<<j);
					}
				}
			}
			for (int j = 0; j < sum; j++) {
				d[n[j]][m[j]] = true;
			}
			dp[x][y][bit] = min(dp[x][y][bit], o);
		}
	}
	if (t) {
		int bit = 0;
		for (int j = 0; j < 4; j++) {
			int xx = x + dx[j], yy = y + dy[j];
			if (xx >= 0 && xx < a&&yy >= 0 && yy < b) {
				if (!d[xx][yy] && c[xx][yy]) {
					bit |= (1 << j);
				}
			}
		}
		dp[x][y][bit] = min(dp[x][y][bit], z);
	}
}
void kousin(int x,int y,int z) {
	for (int i = 0; i < 4; i++) {
		if (z&(1 << i)) {
			d[x + dx[i]][y + dy[i]] = false;
		}
	}
	bool S = false;
	if (c[x][y]) {
		d[x][y] = false;
		S = true;
	}
	if(x+1<a)decide(x + 1, y, dp[x][y][z]);
	if(y+1<b)decide(x, y+1, dp[x][y][z]);
	if (S) {
		d[x][y] = true;
	}
	for (int i = 0; i < 4; i++) {
		if (z&(1 << i)) {
			d[x + dx[i]][y + dy[i]] = true;
		}
	}
}
int main() {
	memset(dp, 0x3f, sizeof(dp));
	cin >> a >> b;
	for (int e = 0; e < a; e++) {
		string f; cin >> f;
		for (int g = 0; g < b; g++) {
			if (f[g] != '.') {
				c[e][g] = f[g] - '0';
				d[e][g] = true;
			}
		}
	}
	dp[0][0][0] = 0;
	for (int i = 0; i < a + b - 2; i++) {
		for (int x = 0; x < a&&x<=i; x++) {
			int y = i - x;
			if (y < 0 || y >= b)continue;
			for (int z = 0; z < 16; z++) {
				if (dp[x][y][z] != 1061109567) {
					kousin(x, y, z);
				}
			}
		}
	}
	int MIN = 1<<29;
	for (int i = 0; i < 16; i++) {
		MIN = min(MIN, dp[a - 1][b - 1][i]);
	}
	cout << MIN << endl;
}

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

#include <iostream>
#define int long long
using namespace std;

int n, m, k;
int a[20000];
int dp[20000];

int dfs(int id) {
	if (id >= n) return 0;
	if (dp[id] != 0) return dp[id];

	int maxi = -1145141919;
	int mini = 1145141919;
	for (int s = 1; s <= m; s++) {
		if (id + s > n) { continue; }
		maxi = max(maxi, a[id + s - 1]);
		mini = min(mini, a[id + s - 1]);
		ret = min(ret, dfs(id + s) + k + s * (maxi - mini));
	}
	return (dp[id] = ret);
}

signed main() {
	cin >> n >> m >> k;
	for (int i = 0; i < n; i++) cin >> a[i];
	cout << dfs(0) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int dfs(long long int)':
a.cc:19:17: error: 'ret' was not declared in this scope
   19 |                 ret = min(ret, dfs(id + s) + k + s * (maxi - mini));
      |                 ^~~
a.cc:21:26: error: 'ret' was not declared in this scope
   21 |         return (dp[id] = ret);
      |                          ^~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define int long long

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T get(){T a;cin>>a;return a;}
template<typename T>T rev(T a){reverse(all(a));return a;}
template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}

const int inf = 3e18;
const ll linf = 3e18;
const double eps = 1e-9;

int N, M, K;
int A[20005];
int memo[20005];

inline :int rec(int now)
{
    if (~memo[now]) return memo[now];

    int res = inf;
    int mi = inf, ma = -inf;
    
    for (int i = 0, to = min(N - now, M); i < to; ++i) {
        mi = min(mi, A[now + i]);
        ma = max(ma, A[now + i]);

        res = min(res, K + (ma - mi) * (i + 1) + rec(now + i + 1));
    }

    if (res == inf) res = 0;

    return memo[now] = res;
}

signed main()
{ // #define int long long ?????????????????§scanf???????????¨???????????????????????\?????????????????????
    omajinai;
    cin >> N >> M >> K;

    rep(i, N) {
        cin >> A[i];
    }

    memset(memo, -1, sizeof (memo));

    cout << rec(0) << endl;
}

Compiler output:
a.cc:56:8: error: expected unqualified-id before ':' token
   56 | inline :int rec(int now)
      |        ^
a.cc: In function 'int main()':
a.cc:86:13: error: 'rec' was not declared in this scope; did you mean 'rev'?
   86 |     cout << rec(0) << endl;
      |             ^~~
      |             rev
Language: C++

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

#define int long long

signed main() {
	int N, M, K; cin >> N >> M >> K;
	vector<int> A(N); input(A);
	vector<int> v(N + 1);
	rep(i, N) {
		cin >> A[i];
		int minv = 1ll << 60, maxv = -1;
		int ans = 1ll << 60;
		rep(j, M * (i - j >= 0)) {
			int a = A[i - j];
			minv = min(minv, a);
			maxv = max(maxv, a);
			ans = min(ans, K + (j + 1) * (maxv - minv) + v[i - j]);
		}
		v[i + 1] = ans;
	}
	cout << v[N] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: 'input' was not declared in this scope; did you mean 'int'?
    8 |         vector<int> A(N); input(A);
      |                           ^~~~~
      |                           int
a.cc:10:13: error: 'i' was not declared in this scope
   10 |         rep(i, N) {
      |             ^
a.cc:10:9: error: 'rep' was not declared in this scope
   10 |         rep(i, N) {
      |         ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>

using namespace std;

#define rep(i,a,n) for(int i = a; n > i; i++)
#define REP(i,n) rep(i,0,n)
#define MP(a,b) make_pair(a,b)
#define ALL(a) (a).begin(),(a).end()
typedef pair<int,int> pii;
typedef long long ll;

#define int ll
int main(){
	int n;
	scanf("%lld%*c", &n);
	int jsum = 0,osum = 0,isum = 0;
	vector<char> str(n);
	REP(i,n){
		scanf("%c", &str[i]);
		switch(str[i]){
			case 'J':
				jsum++;
				break;
			case 'O':
				osum++;
				break;
			case 'I':
				isum++;
				break;
		}
	}
	int cans[3] = {},Oad = 0, cj = 0,ci = isum;
	REP(i,n){
		if(str[i] == 'O'){
			cans[0] += (cj+1)*ci;
			cans[1] += cj*ci;
			Oad = max(Oad, cj*ci);
			cans[2] += cj*(ci+1);
		}
		else if(str[i] == 'I'){
			ci--;
		}
		else{
			cj++;
		}

	}

	cans[1] += Oad;

	printf("%lld\n", max({cans[0], cans[1], cans[2]}));


	return 0;
}

Compiler output:
a.cc:20:13: error: '::main' must return 'int'
   20 | #define int ll
      |             ^~
a.cc:21:1: note: in expansion of macro 'int'
   21 | int main(){
      | ^~~
Language: C++

#include<iostream>
#include<functional>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
#pragma warning(disable:4996)
int n, m, q, a[1 << 18], b[1 << 18], c[1 << 18], d[1 << 18], e[1 << 18], dist[1 << 18]; vector<pair<int, int>>x[1 << 18], y[1 << 18];
int main() {
	scanf("%d%d%d", &n, &m, &q);
	fill(d, d + m + 1, 1 << 30);
	for (int i = 1; i <= m; i++) scanf("%d%d", &a[i], &b[i]);
	for (int i = 1; i <= q; i++) scanf("%d", &c[i]), d[c[i]] = i;
	for (int i = 1; i <= m; i++) {
		x[a[i]].push_back(make_pair(b[i], d[i]));
		x[b[i]].push_back(make_pair(a[i], d[i]));
	}
	fill(dist, dist + n + 1, -1); dist[1] = 0;
	queue<int> Q1; Q1.push(1);
	while (!Q1.empty()) {
		int a1 = Q1.front(); Q1.pop();
		for (pair<int, int> i : x[a1]) {
			if (dist[i.first] == -1) {
				dist[i.first] = dist[a1] + 1;
				Q1.push(i.first);
			}
		}
	}
	for (int i = 1; i <= n; i++) {
		for (pair<int, int> j : x[i]) {
			if (dist[i] < dist[j.first]) y[i].push_back(j);
		}
	}
	queue<pair<int, int> >Q; Q.push(make_pair(1 << 30, 1)); e[1] = (1 << 30);
	while (!Q.empty()) {
		int a1 = Q.top().first, a2 = Q.top().second; Q.pop();
		for (int i = 0; i < y[a2].size(); i++) {
			if (e[y[a2][i].first] < min(y[a2][i].second, a1)) {
				e[y[a2][i].first] = min(y[a2][i].second, a1);
				Q.push(make_pair(e[y[a2][i].first], y[a2][i].first));
			}
		}
	}
	sort(e + 1, e + n + 1);
	int T = 1;
	for (int i = 1; i <= q; i++) {
		while (e[T] <= i) T++;
		printf("%d\n", T - 1);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:28: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
   36 |                 int a1 = Q.top().first, a2 = Q.top().second; Q.pop();
      |                            ^~~
      |                            pop
a.cc:37:39: error: 'a2' was not declared in this scope; did you mean 'a1'?
   37 |                 for (int i = 0; i < y[a2].size(); i++) {
      |                                       ^~
      |                                       a1
Language: C++

//-------------------------------------------
//-               Train Fare                -
//-                                         -
//-       autumn_eel niha katemasen!        -
//-------------------------------------------



void reader(int *x) {
	int k = getchar_unlocked(); *x = k - '0';
	while (true) {
		k = getchar_unlocked();
		if (k < '0' || k > '9') break;
		*x = ((*x) << 1) + ((*x) << 3) + k - '0';
	}
}
void writeln(int x) {
	int s = 0; char f[10];
	while (x) {
		f[s++] = x % 10;
		x /= 10;
	}
	if (!s) f[s++] = 0;
	while (s--) putchar_unlocked(f[s] + '0');
	putchar_unlocked('\n');
}

#include<iostream>
#include<functional>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
#pragma warning(disable:4996)
int n, m, q, a[200003], b[200003], c[200003], d[200003], e[100003], dist[100003], E[200003];
vector<pair<int, int> > z[100003]; vector<int> x[100003];
vector<int>D[100003];
int main() {
	reader(&n); reader(&m); reader(&q);
	fill(d, d + m + 1, 1 << 30);
	for (int i = 1; i <= m; i++) reader(&a[i]), reader(&b[i]);
	for (int i = 1; i <= q; i++) reader(&c[i]), d[c[i]] = i;
	for (int i = 1; i <= m; i++) {
		x[a[i]].push_back(b[i]);
		x[b[i]].push_back(a[i]);
	}
	fill(dist, dist + n + 1, -1); dist[1] = 0;
	queue<int> Q1; Q1.push(1);
	while (!Q1.empty()) {
		int a1 = Q1.front(); Q1.pop();
		for (int i : x[a1]) {
			if (dist[i] == -1) {
				dist[i] = dist[a1] + 1;
				Q1.push(i);
			}
		}
	}
	for (int i = 1; i <= m; i++) {
		if (dist[a[i]] > dist[b[i]]) z[a[i]].push_back(make_pair(b[i], d[i]));
		if (dist[b[i]] > dist[a[i]]) z[b[i]].push_back(make_pair(a[i], d[i]));
	}
	for (int i = 1; i <= n; i++) D[dist[i]].push_back(i);
	e[1] = (1 << 30);
	for (int i = 1; i < n; i++) {
		for (int j : D[i]) {
			for (pair<int, int>k : z[j]) {
				e[j] = max(e[j], min(e[k.first], k.second));
			}
		}
	}
	for (int i = 2; i <= n; i++) {
		if (e[i] < 300000) E[e[i]]++;
	}
	for (int i = 1; i <= q; i++) {
		E[i] += E[i - 1];
		writeln(E[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'void reader(int*)':
a.cc:10:17: error: 'getchar_unlocked' was not declared in this scope
   10 |         int k = getchar_unlocked(); *x = k - '0';
      |                 ^~~~~~~~~~~~~~~~
a.cc: In function 'void writeln(int)':
a.cc:24:21: error: 'putchar_unlocked' was not declared in this scope
   24 |         while (s--) putchar_unlocked(f[s] + '0');
      |                     ^~~~~~~~~~~~~~~~
a.cc:25:9: error: 'putchar_unlocked' was not declared in this scope
   25 |         putchar_unlocked('\n');
      |         ^~~~~~~~~~~~~~~~
Language: C++

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

void reader(int *x) {
	int k = getchar_unlocked(); *x = k - '0';
	while (true) {
		k = getchar_unlocked();
		if (k < '0') break;
		*x = ((*x) << 1) + ((*x) << 3) + k - '0';
	}
}
inline void writeln(int x) {
	int s = 0; char f[7];
	while (x) {
		f[s++] = x % 10;
		x /= 10;
	}
	if (!s) f[s++] = 0;
	while (s--) putchar_unlocked(f[s] + '0');
	putchar_unlocked('\n');
}

vector<int>E[100000];
int u[200000], v[200000], r[200000], ans[200000], d[100000]{ 1 }, cnt = 1;
char b[200000], ok[100000]{ 1 };
deque<int>que;

void bfs(int u, char t) {
	que.emplace_back(u);
	while (!que.empty()) {
		int p = que.front(); que.pop_front();
		for (int v : E[p]) {
			if (t) {
				if (d[v] > d[p] && !ok[v]) {
					ok[v] = 1; cnt++; que.emplace_back(v);
				}
			}
			else if (!d[v]) {
				d[v] = d[p] + 1; que.emplace_back(v);
			}
		}
	}
}
int main() {
	int n, m, q; reader(&n); reader(&m); reader(&q);
	rep(i, m) {
		reader(&u[i]); reader(&v[i]);
		u[i]--; v[i]--;
		E[u[i]].emplace_back(v[i]); E[v[i]].emplace_back(u[i]);
	}
	bfs(0, 0);
	rep(i, m) {
		if (d[u[i]] > d[v[i]])swap(u[i], v[i]);
	}
	rep(i, n)E[i].clear();
	rep(i, q) {
		reader(&r[i]); r[i]--;
		b[r[i]] = 1;
	}
	rep(i, m) {
		if (!b[i]) {
			if (d[v[i]] > d[u[i]]) {
				E[u[i]].emplace_back(v[i]);
			}
		}
	}
	bfs(0, 1);
	for (int i = q - 1; i >= 0; i--) {
		ans[i] = n - cnt;
		if (d[v[r[i]]] > d[u[r[i]]] && !ok[v[r[i]]]) {
			E[u[r[i]]].emplace_back(v[r[i]]);
			if (ok[u[r[i]]]) {
				cnt++; ok[v[r[i]]] = 1;
				bfs(v[r[i]], 1);
			}
		}
	}
	rep(i, q)writerln(ans[i]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:79:18: error: 'writerln' was not declared in this scope; did you mean 'writeln'?
   79 |         rep(i, q)writerln(ans[i]);
      |                  ^~~~~~~~
      |                  writeln
Language: C++

#include <stdio.h>
#include<vector>
#include<deque>

using namespace std;
#define mygc(c) (c)=getchar_unlocked()
#define mypc(c) putchar_unlocked(c)
void reader(int& x) { int k, m = 0; x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; }if ('0' <= k&&k <= '9') { x = k - '0'; break; } }for (;;) { mygc(k); if (k<'0' || k>'9')break; x = x * 10 + k - '0'; }if (m) x = -x; }
void writer(int x, char c) { int s = 0, m = 0; char f[10]; if (x<0)m = 1, x = -x; while (x)f[s++] = x % 10, x /= 10; if (!s)f[s++] = 0; if (m)mypc('-'); while (s--)mypc(f[s] + '0'); mypc(c); }
template<class T> void writerLn(T x) { writer(x, '\n'); }
#define rep(i,n)for(int i=0;i<n;i++)
vector<int>E[100000];
int u[200000], v[200000], r[200000], ans[200000], d[100000], cnt = 1;
char b[200000], ok[100000]{ 1 };
deque<int>que;

void bfs(int u, int t) {
	que.emplace_back(u);
	while (!que.empty()) {
		int p = que.front(); que.pop_front();
		for (int v : E[p]) {
			if (t) {
				if (d[v] > d[p] && !ok[v]) {
					ok[v] = 1; cnt++; que.emplace_back(v);
				}
			}
			else if (!~d[v]) {
				d[v] = d[p] + 1; que.emplace_back(v);
			}
		}
	}
}
int main() {
	int n, m, q; reader(n); reader(m); reader(q);
	rep(i, m) {
		reader(u[i]); reader(v[i]);
		u[i]--; v[i]--;
		E[u[i]].emplace_back(v[i]); E[v[i]].emplace_back(u[i]);
	}
	memset(d, -1, sizeof(d));
	d[0] = 0; bfs(0, 0);
	rep(i, m) {
		if (d[u[i]] > d[v[i]])swap(u[i], v[i]);
	}
	rep(i, n)E[i].clear();
	rep(i, q) {
		reader(r[i]); r[i]--;
		b[r[i]] = 1;
	}
	rep(i, m) {
		if (!b[i]) {
			if (d[v[i]] > d[u[i]]) {
				E[u[i]].emplace_back(v[i]);
			}
		}
	}
	bfs(0, 1);
	for (int i = q - 1; i >= 0; i--) {
		ans[i] = n - cnt;
		if (d[v[r[i]]] > d[u[r[i]]] && !ok[v[r[i]]]) {
			E[u[r[i]]].emplace_back(v[r[i]]);
			if (ok[u[r[i]]]) {
				cnt++; ok[v[r[i]]] = 1;
				bfs(v[r[i]], 1);
			}
		}
	}
	rep(i, q)writerLn(ans[i]);
}

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

#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<functional>
#define PAIR pair<int,int>
using namespace std;
class road {
public:
	int from, to;
	bool use;
	road() :use(true) {

	}
};
class town {
public:
	int fast;
	bool used, said;
	vector<road*> road;
	int num;
	town():used(false),num(0),said(false) {

	}
};
int main() {
	int N, M, Q;
	cin >> N >> M >> Q;
	town *map;
	map = new town[N + 1];
	road *train;
	train = new road[M * 2 + 1];
	int a, b;
	for (int i = 1; i <= M; ++i) {
		cin >> a >> b;
		train[i].from = a;
		train[i].to = b;
		train[i + M].from = b;
		train[i + M].to = a;
		map[a].road.push_back(&train[i]);
		map[b].road.push_back(&train[i + M]);
	}
	priority_queue<PAIR, vector<PAIR>, greater<PAIR> > que;
	PAIR dummy;
	que.push(PAIR(0, 1));
	while (!que.empty()) {
		dummy = que.top(); que.pop();
		if (map[dummy.second].used) {
			continue;
		}
		map[dummy.second].used = true;
		map[dummy.second].fast = dummy.first;
		for (int i = 0, nmax = map[dummy.second].road.size(); i < nmax; ++i) {
			if (map[map[dummy.second].road[i]->to].used == false) {
				que.push(PAIR(dummy.first + 1, map[dummy.second].road[i]->to));
			}
		}
	}
	for (int i = 1; i <= N; ++i) {
		for (int j = 0, nmax = map[i].road.size(); j < nmax; ++j) {
			if (map[map[i].road[j]->to].fast - map[i].fast == 0) {
				map[i].road[j]->use = false;
				swap(map[i].road[j], map[i].road[nmax - 1]);
				map[i].road.pop_back();
				--nmax;
			}
			else if (map[map[i].road[j]->to].fast - map[i].fast == -1) {
				++map[i].num;
				map[i].road[j]->use = false;
				swap(map[i].road[j], map[i].road[nmax - 1]);
				map[i].road.pop_back();
				--nmax;
				--j;
			}
		}
	}
	int answer = 0;
	int up;
	queue<int> say;
	for (int i = 0; i < Q; ++i) {
		cin >> up;
		if (train[up].use) {
			say.push(train[up].to);
			train[up].use = false;
		}
		else if (train[up + M].use) {
			say.push(train[up + M].to);
			train[up + M].use = false;
		}
		while (!say.empty()) {
			int mati = say.front(); say.pop();
			if (map[mati].said) {
				continue;
			}
			else if (--map[mati].num != 0) {
				continue;
			}
			++answer;
			map[mati].said = true;
			for (int i = 0, nmax = map[mati].road.size(); i < nmax; ++i) {
				if (map[mati].road[i]->use) {
					say.push(map[mati].road[i]->to);
				}
				else {
					swap(map[mati].road[i], map[mati].road[nmax - 1]);
					--i;
					--nmax;
					map[mati].road.pop_back();
				}
			}
		}
		cout << answer << endl;
	}
	return 0;
}

Compiler output:
a.cc:20:23: error: declaration of 'std::vector<road*> town::road' changes meaning of 'road' [-Wchanges-meaning]
   20 |         vector<road*> road;
      |                       ^~~~
a.cc:20:16: note: used here to mean 'class road'
   20 |         vector<road*> road;
      |                ^~~~
a.cc:8:7: note: declared here
    8 | class road {
      |       ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<set>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#define p pair<int,int>
using namespace std;

p d[100000];
vector<int>rinsetu[100000];
int mincost[100000];
set<int>k[100000];
int l[100000];
int main() {
	memset(mincost, -1, sizeof(mincost));
	int a, b, c;
	cin >> a >> b >> c;
	for (int e = 0; e < b; e++) {
		int f, g; scanf("%d%d", &f, &g); f--; g--;
		d[e] = p(f, g);
		rinsetu[f].push_back(g);
		rinsetu[g].push_back(f);
	}
	queue<int>Q;
	Q.push(0);
	mincost[0] = 0;
	while (Q.size()) {
		int h = Q.front(); Q.pop();
		for (int i : rinsetu[h]) {
			if (mincost[i] == -1) {
				k[h].insert(i);
				l[i]++;
				mincost[i] = mincost[h] + 1;
				Q.push(i);
			}
			else if (mincost[i] == mincost[h] + 1) {
				k[h].insert(i);
				l[i]++;
			}
		}
	}
	int sum = 0;
	for (int i = 0; i < c; i++) {
		int j; scanf("%d", &j); j--;
		auto v= k[d[j].first].find(d[j].second), t= k[d[j].second].find(d[j].first);
		if (v!=k[d[j].first].end()) {
			k[d[j].first].erase(v);
			l[d[j].second]--;
			if (l[d[j].second] == 0) {
				queue<int>que;
				que.push(d[j].second);
				while (que.size()) {
					int u = que.front(); que.pop(); sum++; 
					for (auto w = k[u].begin(); w != k[u].end(); w++) {
						l[*w]--;
						if (l[*w] == 0)que.push(*w);
						k[u].erase(w); w--;
					}
				}
			}
		}
		else if (t!= k[d[j].second].end()) {
			k[d[j].second].erase(v);
			l[d[j].first]--;
			if (l[d[j].first] == 0) {
				queue<int>que;
				que.push(d[j].first);
				while (que.size()) {
					int u = que.front(); que.pop();  sum++; 
					for (auto w = k[u].begin(); w != k[u].end(); w++) {
						l[*w]--;
						if (l[*w] == 0)que.push(*w);
						k[u].erase(w); w--;
					}
				}
			}
		}
		cout << sum<< endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'memset' was not declared in this scope
   18 |         memset(mincost, -1, sizeof(mincost));
      |         ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<queue>
  +++ |+#include <cstring>
    9 | #define p pair<int,int>
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<set>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#define p pair<int,int>
using namespace std;

p d[200000];
vector<int>rinsetu[100000];
int mincost[100000];
set<int>k[100000];
int l[100000];
int main() {
	memset(mincost, -1, sizeof(mincost));
	int a, b, c;
	cin >> a >> b >> c;
	for (int e = 0; e < b; e++) {
		int f, g; scanf("%d%d", &f, &g); f--; g--;
		d[e] = p(f, g);
		rinsetu[f].push_back(g);
		rinsetu[g].push_back(f);
	}
	queue<int>Q;
	Q.push(0);
	mincost[0] = 0;
	while (Q.size()) {
		int h = Q.front(); Q.pop();
		for (int i : rinsetu[h]) {
			if (mincost[i] == -1) {
				k[h].insert(i);
				l[i]++;
				mincost[i] = mincost[h] + 1;
				Q.push(i);
			}
			else if (mincost[i] == mincost[h] + 1) {
				k[h].insert(i);
				l[i]++;
			}
		}
	}
	int sum = 0;
	for (int i = 0; i < c; i++) {
		int j; scanf("%d", &j); j--;
		auto v= k[d[j].first].find(d[j].second), t= k[d[j].second].find(d[j].first);
		if (v!=k[d[j].first].end()) {
			k[d[j].first].erase(v);
			l[d[j].second]--;
			if (l[d[j].second] == 0) {
				queue<int>que;
				que.push(d[j].second);
				while (que.size()) {
					int u = que.front(); que.pop(); sum++; 
					for (auto w = k[u].begin(); w != k[u].end(); w++) {
						l[*w]--;
						if (l[*w] == 0)que.push(*w);
						k[u].erase(w); w--;
					}
				}
			}
		}
		else if (t!= k[d[j].second].end()) {
			k[d[j].second].erase(v);
			l[d[j].first]--;
			if (l[d[j].first] == 0) {
				queue<int>que;
				que.push(d[j].first);
				while (que.size()) {
					int u = que.front(); que.pop();  sum++; 
					for (auto w = k[u].begin(); w != k[u].end(); w++) {
						l[*w]--;
						if (l[*w] == 0)que.push(*w);
						k[u].erase(w); w--;
					}
				}
			}
		}
		cout << sum<< endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'memset' was not declared in this scope
   18 |         memset(mincost, -1, sizeof(mincost));
      |         ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<queue>
  +++ |+#include <cstring>
    9 | #define p pair<int,int>
Language: C++

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

struct Edge{
  int to,cost;
};

struct Node{
  int num,val;
  bool operator<(const Node &r)const{
    return val > r.val;
  }
};

priority_queue<Node> que;

int main(){

  int n,m,q;
  int u[200005];
  int v[200005];
  vector<Edge> edge[100005];
  vector<Edge> test[100005];
  int dist[100005];
  int cnt[100005];
  memset(dist,-1,sizeof(dist));
  memset(cnt,0,sizeof(cnt));

  cin >> n >> m >> q;
  for(int i = 0; i < m; i++){
    int a,b;
    cin >> a >> b;
    a--;b--;
    test[a].push_back((Edge){b,1});
    test[b].push_back((Edge){a,1});
    u[i] = a;
    v[i] = b;
  }

  que.push((Node){0,0});
  while(!que.empty()){
    int num = que.top().num;
    int val = que.top().val;
    que.pop();
    if(dist[num] != -1)continue;
    dist[num] = val;
    for(int i = 0; i < test[num].size(); i++){
      que.push((Node){test[num][i].to,val + test[num][i].cost});
    }
  }

  for(int i = 0; i < n; i++){
    for(int j = 0; j < test[i].size(); j++){
      if(dist[i] + 1 == dist[test[i][j].to]){
	edge[i].push_back((Edge){test[i][j].to,1});
	
	cnt[test[i][j].to]++;
      }
    }
  }
  
  int ans = 0;
  queue<int> bfs;
  for(int i = 0; i < q; i++){
    int r;
    cin >> r;
    r--;
    if(u[r] > v[r]){
      int tmp = u[r];
      u[r] = v[r];
      v[r] = tmp;
    }
    for(int j = 0; j < edge[u[r]].size(); j++){
      if(edge[u[r]][j].to == v[r]){
	edge[u[r]].erase(edge[u[r]].begin() + j);
	cnt[v[r]]--;
	if(cnt[v[r]] == 0){
	  ans++;
	  bfs.push(v[r]);
	  while(!bfs.empty()){
	    int idx = bfs.front();
	    bfs.pop();
	    for(int k = 0; k < edge[idx].size(); k++){
		cnt[edge[idx][k].to]--;
		if(cnt[edge[idx][k].to] == 0)ans++;
		bfs.push(edge[idx][k].to);
	      }
	    }
	  }
	}
	break;
      }
    }
    cout << ans << endl;
  }

}

Compiler output:
a.cc:97:1: error: expected declaration before '}' token
   97 | }
      | ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>

using ll = long long;
using namespace std;
using pll = pair<ll, ll>;

#define In_(x) scanf("%lld",&x)

ll n, m, q;
ll u[200000], v[200000];
vector<pll>graph[100000];
ll dist[100000];
ll parnum[100000];
bool alive[100000];
set<ll>answer;

ll main()
{
	//Input
	In_(n);
	In_(m);
	In_(q);
	for (ll i = 0; i < m; ++i)
	{
		ll u_, v_;
		In_(u_); In_(v_);
		--u_; --v_;
		u[i] = u_; v[i] = v_;
		graph[u_].push_back({ v_,i });
		graph[v_].push_back({ u_,i });
	}
	//BFS
	fill(parnum, parnum + n, 0);
	fill(dist, dist + n, -1);
	dist[0] = 0;
	queue<ll> que;
	que.push(0);
	while (!que.empty())
	{
		ll p = que.front(); que.pop();
		for (auto rawq : graph[p])
		{
			ll next = rawq.first;
			if (dist[next] == -1)
			{
				dist[next] = dist[p] + 1;
				que.push(next);
				++parnum[next];
			}
			else if (dist[next] == dist[p] + 1)
			{
				++parnum[next];
			}
		}
	}
	//Solve For Query
	fill(alive, alive + n, true);
	for (ll k = 0; k < q; ++k)
	{
		ll qur; In_(qur);
		--qur;
		if (dist[v[qur]] != dist[u[qur]])
		{
			queue<ll>que;
			ll pus = v[qur];
			if (dist[v[qur]] < dist[u[qur]])pus = u[qur];
			que.push(pus);
			while (!que.empty())
			{
				ll vec = que.front(); que.pop();
				if (!alive[vec])continue;
				--parnum[vec];
				if (parnum[vec] == 0)
				{
					answer.emplace(vec);
					alive[vec] = false;
					for (auto to : graph[vec])
					{
						if (dist[to.first] == dist[vec] + 1 && alive[to.first])
						{
							que.push(to.first);
						}
					}
				}
			}
		}
		ll count = 0;
		for (ll i = 0; i < n; ++i)
		{
			if (!alive[i])++count;
		}
		while (count != answer.size()) {}
		printf("%d\n", answer.size());
	}
	return 0;
}

Compiler output:
a.cc:21:1: error: '::main' must return 'int'
   21 | ll main()
      | ^~
Language: C++

* 2016-ho-t4.cpp
 *
 *  Created on: 2017/02/09
 *      Author: joi
 */
#include<cstdio>
#include<cstring>
int main(void){
	int a[200][200];
	char b[100];
	int n,k;
	scanf("%d %d",&n,&k);
	scanf("%s",b);
	for(int i=0;i<200;i++){
		for(int j=0;j<200;j++){
			a[i][j]=0;
		}
	}
	int x,y;
	int ans;
	x=100;
	y=100;
	a[100][100]=1;
	for(int i=0;i<n;i++){
		if(b[i]=='E'){
			x++;
		}
		if(b[i]=='W'){
			x--;
		}
		if(b[i]=='N'){
			y++;
		}
		if(b[i]=='S'){
			y--;
		}
		a[x][y]=1;
	}
	for(int i=0;i<199;i++){
		for(int j=0;j<199;j++){
			if(a[i][j]==1&&a[i][j+1]==1&&a[i+1][j]==1&&a[i+1][j+1]==1){
				ans++;
			}
		}
	}
	printf("%d\n",ans);
}

Compiler output:
a.cc:3:25: error: invalid digit "9" in octal constant
    3 |  *  Created on: 2017/02/09
      |                         ^~
a.cc:1:3: error: expected unqualified-id before numeric constant
    1 | * 2016-ho-t4.cpp
      |   ^~~~
Language: C++

k=int(input().split()[1])
x=y=0
a={(0,0)}
for s in input():
 if'E'==s:x+=1
 if'N'==s:y+=1
 if'W'==s:x-=1
 if'S'==s:y-=1
 a|={(x,y)}
b=set(a)
b|={(u+x*i,v+y*i)for u,v in a for i in range(1,k)}
print(sum(1 for x,y in b if{(x,y),(x+1,y),(x,y+1),(x+1,y+1)}<b))


Compiler output:
a.cc:1:1: error: 'k' does not name a type
    1 | k=int(input().split()[1])
      | ^
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for s in input():
      | ^~~
a.cc:10:1: error: 'b' does not name a type
   10 | b=set(a)
      | ^
a.cc:12:6: error: expected constructor, destructor, or type conversion before '(' token
   12 | print(sum(1 for x,y in b if{(x,y),(x+1,y),(x,y+1),(x+1,y+1)}<b))
      |      ^
a.cc:12:61: error: expected unqualified-id before '<' token
   12 | print(sum(1 for x,y in b if{(x,y),(x+1,y),(x,y+1),(x+1,y+1)}<b))
      |                                                             ^
Language: C

#include  <stdio.h>

int main(void)
{
	int a[5];
	int time;
	int i;

	for (i = 0; i <= 4; i++) {
		scanf_s("%d", &a[i]);
	}

	if (a[0] <= 0) {
		time = a[2] * (0 - a[0]) + a[3] + a[4] * a[1];
	}
	else {
		time = a[4] * (a[1] - a[0]);
	}

	printf("%d", time);

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |                 scanf_s("%d", &a[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C

#include<stdio.h>
#include<iostream>
using namespace std;
int main(void)
{
	int a, b, c, d, e, ans;
	scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
	ans = b*e;
	if (a < 0)
		ans += -1 * a*c + d;
	else if (a == 0)
		ans += d;
	printf("%d\n", ans);
	return 0;
}

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

#include<stdio.h>
#include<iostream>
using namespace std;
int main(void)
{
	int a, b, c, d, e, ans;
	scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
	if (a < 0)
		ans = b*e + -1 * a*c + d;
	else if (a == 0)
		ans = b*e + d;
	else
		ans = (b - a)*e;
	printf("%d\n", ans);
	return 0;
}

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

#include<stdio.h>
#include<iostream>
using namespace std;

int main(void)
{
	int a, b, c, d, e,ondo,f;
	scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);
	if (a > 0)
	{
		f = b - a;
		ondo=f*e;
	}
	else if (a < 0)
	{
		ondo = -a*c + d + b*e;
	}
	else if (a == 0)
	{
		ondo = d + b*e;
	}
	printf("%d\n", ondo);
		return 0;
}

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

square1001?¨±?????????

Compiler output:
a.cc:1:12: error: extended character ± is not valid in an identifier
    1 | square1001?¨±?????????
      |            ^
a.cc:1:1: error: 'square1001' does not name a type
    1 | square1001?¨±?????????
      | ^~~~~~~~~~