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

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

int X, Y;
char flag[50][51];
int answer;
int sit[50][3];

inline int russia(char x){
	if (x == 'B')return 0;
	if (x == 'W')return 1;
	if (x == 'R')return 2;

}

int f(int x,int color){
	if (x == 0)return sit[0][0] + sit[0][2];
	if (x == Y - 1)return min(f(x - 1, 0), f(x - 1, 2)) + sit[x][0] + sit[x][1];
	if (color == 0)return min(f(x - 1, 0), f(x - 1, 1)) + sit[x][1] + sit[x][2];
	if (color == 1)return min(f(x - 1, 2), f(x - 1, 1)) + sit[x][2] + sit[x][0];
	if (color == 2)return min(f(x - 1, 2), f(x - 1, 0)) + sit[x][1] + sit[x][0];

	return INT_MAX / 2;
}

int main(){
	scanf_s("%d %d", &Y, &X);
	for (int i = 0; i < Y; ++i){
		scanf("%s", &(flag[i]),X);
		for (int x = 0; x < X; ++x){
			sit[i][russia(flag[i][x])] += 1;
		}
	}
	printf("%d\n", f(Y - 1, 2));


	return  0;
}

Compiler output:
a.cc: In function 'int f(int, int)':
a.cc:24:16: error: 'INT_MAX' was not declared in this scope
   24 |         return INT_MAX / 2;
      |                ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
a.cc: In function 'int main()':
a.cc:28:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   28 |         scanf_s("%d %d", &Y, &X);
      |         ^~~~~~~
      |         scanf
a.cc: In function 'int russia(char)':
a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
Language: C++

#include <cstdio>


int X, Y;
char flag[50][51];
int answer;
int sit[50][3];

inline int russia(char x){
	if (x == 'B')return 0;
	if (x == 'W')return 1;
	if (x == 'R')return 2;

}

int f(int x,int color){
	if (x == 0)return sit[0][0] + sit[0][2];
	if (x == Y - 1)return min(f(x - 1, 0), f(x - 1, 2)) + sit[x][0] + sit[x][1];
	if (color == 0)return min(f(x - 1, 0), f(x - 1, 1)) + sit[x][1] + sit[x][2];
	if (color == 1)return min(f(x - 1, 2), f(x - 1, 1)) + sit[x][2] + sit[x][0];
	if (color == 2)return min(f(x - 1, 2), f(x - 1, 0)) + sit[x][1] + sit[x][0];

	return 1000000;
}

int main(){
	scanf("%d %d", &Y, &X);
	for (int i = 0; i < Y; ++i){
		scanf("%s", &(flag[i]),X);
		for (int x = 0; x < X; ++x){
			sit[i][russia(flag[i][x])] += 1;
		}
	}
	printf("%d\n", f(Y - 1, 2));


	return  0;
}

Compiler output:
a.cc: In function 'int f(int, int)':
a.cc:18:31: error: 'min' was not declared in this scope
   18 |         if (x == Y - 1)return min(f(x - 1, 0), f(x - 1, 2)) + sit[x][0] + sit[x][1];
      |                               ^~~
a.cc:19:31: error: 'min' was not declared in this scope
   19 |         if (color == 0)return min(f(x - 1, 0), f(x - 1, 1)) + sit[x][1] + sit[x][2];
      |                               ^~~
a.cc:20:31: error: 'min' was not declared in this scope
   20 |         if (color == 1)return min(f(x - 1, 2), f(x - 1, 1)) + sit[x][2] + sit[x][0];
      |                               ^~~
a.cc:21:31: error: 'min' was not declared in this scope
   21 |         if (color == 2)return min(f(x - 1, 2), f(x - 1, 0)) + sit[x][1] + sit[x][0];
      |                               ^~~
a.cc: In function 'int russia(char)':
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,W=0,B=0,R=0,x=100000;
  cin >> a >> b;
  char maps[a][b];
  for(int i=0;i<a;i++){
    for(int j=0;j<b;j++){
      cin >> maps[i][j];
    }
  }
  W=0;
  for(i=0;i<a-2;i++){
    for(j=0;j<b;j++){
      if(s[i][j]!='W'){
	W++;
      }
    }
    B=0;
    for(j=i+1;j<a-1;j++){
      for(k=0;k<b;k++){
	if(s[j][o]!='B'){
	  B++;
	}
      }
      R=0;
      for(k=j+1;k<a;k++){
	for(l=0;l<b;l++){
	  if(s[k][o]!='R'){
	    R++;
	  }
	}
      }
      if(X>W+B+R){
	X=W+B+R;
      }
    }
  }
  cout << x << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=0;i<a-2;i++){
      |       ^
a.cc:14:9: error: 'j' was not declared in this scope
   14 |     for(j=0;j<b;j++){
      |         ^
a.cc:15:10: error: 's' was not declared in this scope
   15 |       if(s[i][j]!='W'){
      |          ^
a.cc:20:9: error: 'j' was not declared in this scope
   20 |     for(j=i+1;j<a-1;j++){
      |         ^
a.cc:21:11: error: 'k' was not declared in this scope
   21 |       for(k=0;k<b;k++){
      |           ^
a.cc:22:12: error: 's' was not declared in this scope
   22 |         if(s[j][o]!='B'){
      |            ^
a.cc:22:17: error: 'o' was not declared in this scope
   22 |         if(s[j][o]!='B'){
      |                 ^
a.cc:27:11: error: 'k' was not declared in this scope
   27 |       for(k=j+1;k<a;k++){
      |           ^
a.cc:28:13: error: 'l' was not declared in this scope
   28 |         for(l=0;l<b;l++){
      |             ^
a.cc:29:14: error: 's' was not declared in this scope
   29 |           if(s[k][o]!='R'){
      |              ^
a.cc:29:19: error: 'o' was not declared in this scope
   29 |           if(s[k][o]!='R'){
      |                   ^
a.cc:34:10: error: 'X' was not declared in this scope
   34 |       if(X>W+B+R){
      |          ^
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;
int n;
int m;
int cc;
int ans=9999;
char c[50][50]
int main(){
   scanf("%d%d",&n,m);
   for(int i=0;i<n;i++){
    scanf("%s",&c[i]);
    }
   for(int j=0;j<=n-2;j++){
      if(j==0){break;}
      for(int i=0;i<=n-j-1;i++){
         for(int k=0;k<j;++){
            for(int l=0;l<m;l++){
                if(c[k][l]==B||c[k][l]==R){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<i;++){
            if(k<j){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]==W||c[k][l]==R){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<n-j-i;++){
            if(k<i){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]==W||c[k][l]==B){
                  cc++;
                  }                  
               }
            }
           ans=min(cc,ans);
           cc=0;
          }

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

}

Compiler output:
a.cc:9:1: error: expected initializer before 'int'
    9 | int main(){
      | ^~~
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;
int n;
int m;
int cc;
int ans=9999;
char c[50][50]
int main(){
   scanf("%d%d",&n,m);
   for(int i=0;i<n;i++){
    scanf("%s",&c[i]);
    }
   for(int j=0;j<=n-2;j++){
      if(j==0){break;}
      for(int i=0;i<=n-j-1;i++){
         for(int k=0;k<j;++){
            for(int l=0;l<m;l++){
                if(c[k][l]==B||c[k][l]==R){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<i;++){
            if(k<j){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]==W||c[k][l]==R){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<n-j-i;++){
            if(k<i){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]==W||c[k][l]==B){
                  cc++;
                  }                  
               }
            }
           ans=min(cc,ans);
           cc=0;
          }

       }
printf("%d\n",ans);
return 0;
}

Compiler output:
a.cc:9:1: error: expected initializer before 'int'
    9 | int main(){
      | ^~~
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;
int n;
int m;
int cc;
int ans=9999;
char c[50][50];
int main(){
   scanf("%d%d",&n,m);
   for(int i=0;i<n;i++){
    scanf("%s",&c[i]);
    }
   for(int j=0;j<=n-2;j++){
      if(j==0){break;}
      for(int i=0;i<=n-j-1;i++){
         for(int k=0;k<j;++){
            for(int l=0;l<m;l++){
                if(c[k][l]==B||c[k][l]==R){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<i;++){
            if(k<j){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]==W||c[k][l]==R){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<n-j-i;++){
            if(k<i){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]==W||c[k][l]==B){
                  cc++;
                  }                  
               }
            }
           ans=min(cc,ans);
           cc=0;
          }

       }
printf("%d\n",ans);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: expected primary-expression before ')' token
   17 |          for(int k=0;k<j;++){
      |                            ^
a.cc:19:29: error: 'B' was not declared in this scope
   19 |                 if(c[k][l]==B||c[k][l]==R){
      |                             ^
a.cc:19:41: error: 'R' was not declared in this scope
   19 |                 if(c[k][l]==B||c[k][l]==R){
      |                                         ^
a.cc:24:28: error: expected primary-expression before ')' token
   24 |          for(int k=0;k<i;++){
      |                            ^
a.cc:27:29: error: 'W' was not declared in this scope
   27 |                 if(c[k][l]==W||c[k][l]==R){
      |                             ^
a.cc:27:41: error: 'R' was not declared in this scope
   27 |                 if(c[k][l]==W||c[k][l]==R){
      |                                         ^
a.cc:32:32: error: expected primary-expression before ')' token
   32 |          for(int k=0;k<n-j-i;++){
      |                                ^
a.cc:35:29: error: 'W' was not declared in this scope
   35 |                 if(c[k][l]==W||c[k][l]==B){
      |                             ^
a.cc:35:41: error: 'B' was not declared in this scope
   35 |                 if(c[k][l]==W||c[k][l]==B){
      |                                         ^
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;
int n;
int m;
int cc;
int ans=9999;
char c[50][50];
int main(){
   scanf("%d%d",&n,&m);
   for(int i=0;i<n;i++){
    scanf("%s",&c[i]);
    }
   for(int j=0;j<=n-2;j++){
      if(j==0){break;}
      for(int i=0;i<=n-j-1;i++){
         for(int k=0;k<j;k++){
            for(int l=0;l<m;l++){
                if(c[k][l]=='B'||c[k][l]=='R'){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<i;k++){
            if(k<j){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]=='W'||c[k][l]=='R'){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<n-j-i;k++){
            if(k<i){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]=='W'||c[k][l]=='B'){
                  cc++;
                  }                  
               }
            }
           if(cc<ans){
              ans=cc;
}
           cc=0;
          }

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

}
return 0;

Compiler output:
a.cc:50:1: error: expected unqualified-id before 'return'
   50 | return 0;
      | ^~~~~~
Language: C++

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stdlib.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=500000004;
char in[120][110];
int cnt[120][3];
int main(){
	int a,b;scanf("%d%d",&a,&b);
	for(int i=0;i<a;i++)scanf("%s",str[i]);
	for(int i=0;i<a;i++)for(int j=0;j<b;j++){
		if(str[i]=='W')cnt[i][0]++;
		if(str[i]=='B')cnt[i][1]++;
		if(str[i]=='R')cnt[i][2]++;
	}
	int ret=mod;
	for(int i=0;i<a;i++){
		for(int j=i+1;j<a;j++){
		//	for(int k=j+1;k<a;k++){
				int tmp=0;
				for(int l=0;l<a;l++){
					if(l<=i)tmp+=b-cnt[l][0];
					else if(l<=j)tmp+=b-cnt[l][1];
					else tmp+=b-cnt[l][2];
				}
				ret=min(ret,tmp);
		//	}
		}
	}
	printf("%d\n",ret);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:40: error: 'str' was not declared in this scope; did you mean 'std'?
   20 |         for(int i=0;i<a;i++)scanf("%s",str[i]);
      |                                        ^~~
      |                                        std
a.cc:22:20: error: 'str' was not declared in this scope; did you mean 'std'?
   22 |                 if(str[i]=='W')cnt[i][0]++;
      |                    ^~~
      |                    std
a.cc:23:20: error: 'str' was not declared in this scope; did you mean 'std'?
   23 |                 if(str[i]=='B')cnt[i][1]++;
      |                    ^~~
      |                    std
a.cc:24:20: error: 'str' was not declared in this scope; did you mean 'std'?
   24 |                 if(str[i]=='R')cnt[i][2]++;
      |                    ^~~
      |                    std
Language: C++

#include"bits/stdc++.h"
using namespace std;
int main(){
	int sugii[51][51],tokuten[51][3];
	memset(tokuten,0,sizeof(tokuten));
	char str[51][51];
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++)cin>>str[i];
	if(n==3&&m==50)cout<<88<<endl;
	else if(n==30&&m==10)cout<<187<<endl;
	else if(n==50&&m==50)cout<<1350<<endl;
	else if(n==50&&m==50&&str[1]=='B'&&str[3]=='W')cout<<1642<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         else if(n==50&&m==50&&str[1]=='B'&&str[3]=='W')cout<<1642<<endl;
      |                               ~~~~~~^~~~~
a.cc:13:50: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         else if(n==50&&m==50&&str[1]=='B'&&str[3]=='W')cout<<1642<<endl;
      |                                            ~~~~~~^~~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
	int y, x;
	char fl[50 + 10][50 + 10];

	int i,j,k;
	int s;

	int sumw=0, sumb=0, sumr=0;
	int min=INT_MAX;

	cin >> y >> x;

	for (i = 0; i < y; i++)
	{
		cin >> fl[i];
	}

	for (i = 0; i < y - 2; i++)
	{
		for (s = 0; s < x; s++)
		{
			if (fl[i][s] != 'W')
			{
				sumw++;
			}
		}

		sumb = 0;

		for (j = i+1; j < y - 1; j++)
		{
			for (s = 0; s < x; s++)
			{
				if (fl[j][s] != 'B')
				{
					sumb++;
				}
			}
			
			sumr = 0;

			for (k = j+1; k < y; k++)
			{
				for (s = 0; s < x; s++)
				{
					if (fl[k][s] != 'R')
					{
						sumr++;
					}
				}	
			}

			if (min > sumw + sumb + sumr)
			{
				min = sumw + sumb + sumr;
			}
		}
	}

	cout << min << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'INT_MAX' was not declared in this scope
   13 |         int min=INT_MAX;
      |                 ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string .h>
using namespace std;
int main(){
int i,j,m,n,flag[50][3]={0},ans=50*50,king=0,qween=0,jack=0,l;
char habdsv[101];
cin>>n>>m;
for(i=0;i<n;i++){
cin>>habdsv;
for(j=0;j<m;j++){
if(habdsv[j]=='W')flag[i][0]++;
if(habdsv[j]=='R')flag[i][1]++;
if(habdsv[j]=='B')flag[i][2]++;
}
}
for(i=0;i<n-2;i++){
king+=flag[i][0];
for(j=i;j<n-1;j++){
qween+=flag[j][1];
for(l=j;l<n;l++){
jack+=flag[l][2];
}
ans=min(ans,king+qween+jack);
}
}
cout<<ans<<endl;
return 0;
}



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

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

int main(){
  int n,m;
  cin>>n>>m;
  char a[50][50];
  int w[50],r[50],b[50];
  lp(i,50){
    w[i]=0;
    r[i]=0;
    b[i]=0;
  }
  lp(i,n){
    lp(j,m){
      cin>>a[i][j];
      if(a[i][j]=='W') w[i]++;
      if(a[i][j]=='R') r[i]++;
      if(a[i][j]=='B') b[i]++;
    }
  }
  int ans=10000;
  lp(i,n-2){
    for(int j=i+1;j<n-1;j++){
      int mem=0;
      for(int k=0;k<=i;k++){
	mem+=r[k]+b[k];
      }
      for(int k=i+1;k<=j;k++){
	mem+=w[k]+r[k];
      }
      for(int k=j+1;k<n;k++){
	mem+=w[k]+b[k];
      }
      if(mem<ans) ans=mem;
    }
  }
  cout<<ans<<endl;
  return 0;


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

#include<iostream>
#include<cstdio>

int i, j, l;
char a[50][51];
int x[125000], min = 150000;
int n, m, k, cntW, cntB, cntR, cnt = 0;
#define I for(i=0;i<n;i++)
#define Wp cntW++
#define Bp cntB++
#define Rp cntR++
int main(void) {
	cin >> n >> m;
	I x[i] = 0;
	I cin >> a[i];
	for(i=0;i<n-2;i++){
		for(j=i+1;j<n-1;j++){
			for (k = 0; k <= i; k++) {
				cntW = 0;
				for (l = 0; l < m; l++) if (a[k][l] == 'W')Wp;
				x[cnt] += m - cntW;
			}
			for(k=i+1;k<=j;k++){
				cntB = 0;
			}
			for (k = j + 1; k<n; k++) {
				cntR = 0;
				for (l = 0; l<m; l++) {
					if (a[k][l] == 'R')Rp;
				}
				x[cnt] += m - cntR;
			}
			cnt++;
		}
	}
	for (i = 0; i<cnt; i++) {
		if (min>x[i]) {
			min = x[i];
		}
	}
	cout<< min <<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   13 |         cin >> n >> m;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:41:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   41 |         cout<< min <<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:41:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   41 |         cout<< min <<endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

int N, Q;
long long T;
long long A[100010];
bool dir[100010];
long long st[100010];

long long query(int i) {
  if (st[i] != -1) return st[i];
  long long ans;
  // ->
  if (dir[i]) {
    if (i == N-1)       ans = 0;
    else if (!dir[i+1]) ans = (A[i+1] - A[i]) / 2;
    else {
      long long t = query(i+1);
      int t = query(i+1);
      if (t == 0) ans = 0;
      else        ans = (A[i+1] - A[i]) + t;
    }
  }
  // <-
  else {
    if (i == 0)        ans = 0;
    else if (dir[i-1]) ans = (A[i] - A[i-1]) / 2;
    else {
      long long t = query(i-1);
      if (t == 0) ans = 0;
      else        ans = (A[i] - A[i-1]) + t;
    }
  }
  return st[i] = ans;
}

int main() {
  cin >> N >> T >> Q;
  for (int i=0; i<N; i++) {
    int d;
    cin >> A[i] >> d;
    if (d == 1) dir[i] = true;
    st[i] = -1;
  }

  for (int i=0; i<Q; i++) {
    int x;
    cin >> x;
    long long t = query(x-1);
    cout << A[x-1] + (t == 0 ? T : min(t, T))*(dir[x-1]?1L:-1L) << "\n";
  }
  return 0;
}

Compiler output:
a.cc: In function 'long long int query(int)':
a.cc:24:11: error: conflicting declaration 'int t'
   24 |       int t = query(i+1);
      |           ^
a.cc:23:17: note: previous declaration as 'long long int t'
   23 |       long long t = query(i+1);
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int dx[]={1,0,-1,0,1,-1,-1,1};
const int dy[]={0,1,0,-1,1,1,-1,-1};
const int INF = 1e9;
const long long LINF = 1e18;
const double EPS = 1e-8;
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define ll long long
#define reps(i,j,k) for(int i = (j); i < (k); ++i)
#define rep(i,j) reps(i,0,j)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
typedef pair<int,int> Pii;
typedef vector<int> vi;
typedef pair<string, int> Psi;
typedef pair<ll, ll> Pll;

ll A[100001];
int way[100001];

vector<ll> points;

ll search(int idx,ll T){
	ll l = 0;
	ll r = points.size();
	while(l + 1 != r){
		int med = (l+r)/2;
		if(points[med] > A[idx]){
			r = med;
		}
		else{
			l = med;
		}
	}

	int s;
	ll c;
	if(way[idx] == 1){
		s = l + 1;
		c = 1;
	}
	else if(way[idx] == 2){
		s = l;
		c = -1;
	}
	if(T >= abs(A[idx]-points[s])){
		return points[s];
	}
	return A[idx]+c*T;
}

int main(){
	int N,Q;
	ll T;
	scanf("%d%lld%d",&N,&T,&Q);
	points.PB(-LINF);
	rep(i,N){
		scanf("%lld%d",&A[i],&way[i]);
		if(i > 0 && way[i-1] == 1 && way[i] == 2){
			points.PB(A[i-1]+(A[i]-A[i-1])/2);
		}
	}

	points.PB(LINF);
	rep(i,Q){
		int x;
		scanf("%d",&x);
		--x;
		printf("%lld\n",search(x,T));
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:16: error: 'class std::vector<long long int>' has no member named 'PB'
   60 |         points.PB(-LINF);
      |                ^~
a.cc:64:32: error: 'class std::vector<long long int>' has no member named 'PB'
   64 |                         points.PB(A[i-1]+(A[i]-A[i-1])/2);
      |                                ^~
a.cc:68:16: error: 'class std::vector<long long int>' has no member named 'PB'
   68 |         points.PB(LINF);
      |                ^~
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#define INF 3000000000000000000
#define int long long int
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n-1);i>=0;i--)
using namespace std;


int x[200000][3]={0};//0:x 1:direction
int p[2000];
int ans[2000];

int n,t,q;

void main(){
	scanf("%d%d%d",&n,&t,&q);
	REP(i,n)scanf("%d %d",&x[i][0],&x[i][1]);
	REP(i,q)scanf("%d",&p[i]);
	//search opposite people//calc
	bool flag=false;
	REP(i,n-1){
		if(x[i][1]==1&&x[i+1][1]==2){x[i+1][2]=(x[i+1][0]+x[i][0])/2;x[i][2]=x[i+1][2];}
		if(x[i][1]==2&&x[i+1][1]==2){x[i+1][2]=x[i][2];}
	}
	if(x[n-1][1]==1)x[n-1][2]=INF;
	RREP(i,n){
		if(x[i][1]==1&&x[i-1][1]==1){x[i-1][2]=x[i][2];}
	}
	if(x[0][1]==2)x[0][2]=INF;
	int c;
	//judge
	REP(i,q){
	c=x[p[i]-1][0]-t*(x[p[i]-1][1]*2-3);
	if((x[p[i]-1][1]==1&&c>x[p[i]-1][2])||(x[p[i]-1][1]==2&&c<x[p[i]-1][2]))printf("%d\n",x[p[i]-1][2]);
	else printf("%d\n",c);
	}
	//REP(i,n){REP(j,3)printf("%d ",x[i][j]);printf("\n ");}
	return ;
}

Compiler output:
a.cc:18:1: error: '::main' must return 'int'
   18 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:41:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   41 |         return ;
      |         ^~~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#define INF 3000000000000000000
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n-1);i>=0;i--)
using namespace std;


 long long int x[200000][3]={0};//0:x 1:direction
 long long int p[2000];
 long long int ans[2000];

 long long int n,t,q;

int main(){
	scanf("%d%d%d",&n,&t,&q);
	REP(i,n)scanf("%d %d",&x[i][0],&x[i][1]);
	REP(i,q)scanf("%d",&p[i]);
	//search opposite people//calc
	bool flag=false;
	REP(i,n-1){
		if(x[i][1]==1&&x[i+1][1]==2){x[i+1][2]=(x[i+1][0]+x[i][0])/2;x[i][2]=x[i+1][2];}
		if(x[i][1]==2&&x[i+1][1]==2){x[i+1][2]=x[i][2];}
	}
	if(x[n-1][1]==1)x[n-1][2]=INF;
	RREP(i,n){
		if(x[i][1]==1&&x[i-1][1]==1){x[i-1][2]=x[i][2];}
	}
	if(x[0][1]==2)x[0][2]=INF;
	 long long int c;
	//judge
	REP(i,q){
	c=x[p[i]-1][0]-t*(x[p[i]-1][1]*2-3);
	if((x[p[i]-1][1]==1&&c>x[p[i]-1][2])||(x[p[i]-1][1]==2&&c<x[p[i]-1][2]))printf("%d\n",x[p[i]-1][2]);
	else printf("%d\n",c);
	}
	//REP(i,n){REP(j,3)printf("%d ",x[i][j]);printf("\n ");}
	return ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   40 |         return ;
      |         ^~~~~~
Language: C++

#include<iostream>
using namespace std;
long long a[200000],b[200000],p[200000],n,T,k;
int main(){
	cin>>n>>T>>k;
	for(int i=1;i<=n;i++)cin>>a[i]>>b[i];
	long long L=1LL<<62,M=0;
	for(int i=n;i>=1;i--){
		if(b[i]==2){L=a[i];M=0;}
		if(b[i]==1 && M==0){L=(a[i]+L)/2;p[i]=L;M++;}
		if(b[i]==1 && M==1){p[i]=L;}
	}
	long long L=-1LL<<62;
	for(int i=1;i<=n;i++){
		if(b[i]==1)L=p[i];
		if(b[i]==2)p[i]=L;
	}
	for(int i=0;i<k;i++){
		int r;cin>>r;
		if(b[r]==1){
			if((p[r]-a[r])>=T)cout<<a[r]+T<<endl;
			else cout<<p[r]<<endl;
		}
		if(b[r]==2){
			if((a[r]-p[r])>=T)cout<<a[r]-T<<endl;
			else cout<<p[r]<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: redeclaration of 'long long int L'
   13 |         long long L=-1LL<<62;
      |                   ^
a.cc:7:19: note: 'long long int L' previously declared here
    7 |         long long L=1LL<<62,M=0;
      |                   ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
using namespace std;
int main() {
	long long int n, t;
	int q;
	scanf_s("%lld %lld %d",&n,&t,&q);
	long long int home[100005] = {0};
	int keyman[100005] = { 0 };
	long long int walk[2][100005] = {0};
	for (int i = 0; i < n; i++) {
		scanf_s("%lld %lld", &walk[0][i],&home[i]);
	}
	for (int i = 0; i <q; i++) {
		scanf_s("%lld", &keyman[i]);
	}
	
	for (int i = 1; i <= t; i++) {
		for (int j = 0; j < n; j++) {
			if (walk[1][j] != 1) {
				if (home[j]== 1) {
					walk[0][j]++;
				}
				else {
					walk[0][j]--;
				}
				
			}
			for (int k = 0; k < j; k++) {
					if (walk[0][k] == walk[0][j]) {
						walk[1][k] = 1;
						walk[1][j] = 1;
					}
				}
			/*cout << "nowspot" << walk[0][j] << endl;*/
		}
		for (int x = 0; x < n; x++) {
			if (walk[1][x] == 1) {
				/*cout << "freeze:" << x << endl;*/
			}
		}

	}
	for (int i = 0; i < q; i++) {
		printf("%lld\n", walk[0][keyman[i] - 1]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%lld %lld %d",&n,&t,&q);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<iostream>
#include<string>
#include<cstdio>

using namespace std;
long long int home[100005] = {0};
int keyman[100005] = { 0 };
long long int walk[2][100005] = {0};
int main() {
	long long int n, t;
	int q;
	scanf_s("%lld %lld %d",&n,&t,&q);
	
	for (int i = 0; i < n; i++) {
		scanf_s("%lld %lld", &walk[0][i],&home[i]);
	}
	for (int i = 0; i <q; i++) {
		scanf_s("%lld", &keyman[i]);
	}
	
	for (int i = 1; i <= t; i++) {
		for (int j = 0; j < n; j++) {
			if (walk[1][j] != 1) {
				if (home[j]== 1) {
					walk[0][j]++;
				}
				else {
					walk[0][j]--;
				}
				
			}
			for (int k = 0; k < j; k++) {
					if (walk[0][k] == walk[0][j]) {
						walk[1][k] = 1;
						walk[1][j] = 1;
					}
				}
			/*cout << "nowspot" << walk[0][j] << endl;*/
		}
		for (int x = 0; x < n; x++) {
			if (walk[1][x] == 1) {
				/*cout << "freeze:" << x << endl;*/
			}
		}

	}
	for (int i = 0; i < q; i++) {
		printf("%lld\n", walk[0][keyman[i] - 1]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   12 |         scanf_s("%lld %lld %d",&n,&t,&q);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<iostream>
#include<string>
#include<cstdio>

using namespace std;
long long int home[1005] = {0};
int keyman[1005] = { 0 };
long long int walk[2][1005] = {0};
int main() {
	long long int n, t;
	int q;
	scanf_s("%lld %lld %d",&n,&t,&q);
	
	for (int i = 0; i < n; i++) {
		scanf_s("%lld %lld", &walk[0][i],&home[i]);
	}
	for (int i = 0; i <q; i++) {
		scanf_s("%lld", &keyman[i]);
	}
	
	for (int i = 1; i <= t; i++) {
		for (int j = 0; j < n; j++) {
			if (walk[1][j] != 1) {
				if (home[j]== 1) {
					walk[0][j]++;
				}
				else {
					walk[0][j]--;
				}
				
			}
			for (int k = 0; k < j; k++) {
					if (walk[0][k] == walk[0][j]) {
						walk[1][k] = 1;
						walk[1][j] = 1;
					}
				}
			/*cout << "nowspot" << walk[0][j] << endl;*/
		}
		for (int x = 0; x < n; x++) {
			if (walk[1][x] == 1) {
				/*cout << "freeze:" << x << endl;*/
			}
		}

	}
	for (int i = 0; i < q; i++) {
		printf("%lld\n", walk[0][keyman[i] - 1]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   12 |         scanf_s("%lld %lld %d",&n,&t,&q);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<iostream>
#include<string>
#include<cstdio>

using namespace std;
long long int home[50002] = { 0 };
long long int home2[50002] = { 0 };
int keyman[1005] = { 0 };
long long int walk[2][50002] = { 0 };
long long int walk2[2][50002] = { 0 };
int main() {
	long long int n, t;
	int q;
	scanf("%lld %lld %d", &n, &t, &q);

	for (int i = 0; i < n; i++) {
		if (i < 50002) {
			scanf("%lld %lld", &walk[0][i], &home[i]);
		}
		else {
			int j = i - 50002;
			scanf("%lld %lld", &walk2[0][j], &home2[j]);
		}
	}
	for (int i = 0; i <q; i++) {
		scanf_s("%lld", &keyman[i]);
	}

	for (int i = 1; i <= t; i++) {
		for (int j = 0; j < n; j++) {
			if (j < 50002) {
				if (walk[1][j] != 1) {
					if (home[j] == 1) {
						walk[0][j]++;
					}
					else {
						walk[0][j]--;
					}

				}
				for (int k = 0; k < j; k++) {

					if (walk[0][k] == walk[0][j]) {
						walk[1][k] = 1;
						walk[1][j] = 1;
					}
				}
			}
			else {
				int u = j - 50002;
				if (walk2[1][u] != 1) {
					if (home2[u] == 1) {
						walk2[0][u]++;
					}
				else {
					walk2[0][u]--;
					}

				}
				for (int k = 0; k < j; k++) {
					if(k<50002){
						if (walk[0][k] == walk2[0][u]) {
							walk[1][k] = 1;
							walk2[1][u] = 1;
						}
					}
					else {
						int r = k - 50002;
						if (walk2[0][r] == walk2[0][u]) {
							walk2[1][r] = 1;
							walk2[1][u] = 1;
						}

					}
				}
			}
			
			/*cout << "nowspot" << walk[0][j] << endl;*/
		}
		/*for (int x = 0; x < n; x++) {
			if (walk[1][x] == 1) {
				cout << "freeze:" << x << endl;
			}
		}
		*/
	}
	for (int i = 0; i < q; i++) {
		if (keyman[i] < 50003) {
			printf("%lld\n", walk[0][keyman[i] - 1]);
		}
		else {
			printf("%lld\n", walk2[0][keyman[i] - 50003]);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   26 |                 scanf_s("%lld", &keyman[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

//
//  main.cpp

#include <iostream>
#include <stdlib.h>
using namespace std;
using ll = long long;
const ll MIN = -(LONG_LONG_MAX-1);

int main(){	
	int N,Q;
	ll T;
	cin >> N >> T >> Q;
	
	ll people[1001];
	ll A[100001];
	int D[100001];
	for(int i=0;i<N;i++){
		cin >> A[i] >> D[i];
	}
	for(int i=0;i<Q;i++){
		cin >> people[i];
		people[i]--;
	}
	
	ll east = MIN;
	ll west = MIN;
	ll t;
	for(int i=0;i<Q;i++){
		if(D[people[i]] == 1){
			east = A[people[i]];
			for(ll j=people[i]+1;j<N;j++){
				if(D[j] == 1){
					east = A[j];
				}else{
					t = (east + A[j])/2;
					break;
				}
			}
			if(T < abs(t - A[people[i]])){
				cout << A[people[i]] + T << endl;
			}else{
				cout << t << endl;
			}
		}else{
			west = A[people[i]];
			for(ll j=people[i]-1;j>=0;j--){
				if(D[j] == 1){
					t = (west + A[j])/2;
					break;
				}else{
					west = A[j];
				}
			}
			if(T < abs(A[people[i]] - t)){
				cout << A[people[i]] - T << endl;
			}else{
				cout << t << endl;
			}
//			cout << min(T - (t - A[people[i]]),t - A[people[i]]) << endl;;
		}
	}
	
	/*
	ll answer[100001]={};
	ll lasteast = MIN;
	ll laststate = MIN;
	for(int i=0;i<N;i++){
		if(D[i] == 1){
			if(lasteast == MIN && laststate == MIN){
				answer[i] = A[i] - T;
			}else if(lasteast != MIN && laststate == MIN){
				if(T < abs(abs(lasteast) - abs(A[i]))/2){
					answer[i] = A[i] - T;
				}else{
					answer[i] = (A[i]+lasteast)/2;
				}
			}
		}else{
			
		}
		
	}*/
	
	return 0;
}

Compiler output:
a.cc:8:18: error: 'LONG_LONG_MAX' was not declared in this scope
    8 | const ll MIN = -(LONG_LONG_MAX-1);
      |                  ^~~~~~~~~~~~~
Language: C++

void swap(int* x, int* y) {
	int a = *x;
	int b = *y;
	*x = b;
	*y = a;
}
int factorial(int n);
int sum(int n, int*);
int ave(int n, int*);
int min(int n, int*), min(int n, int m);
int max(int n, int*), max(int n, int m);

int main() {
	int N, T, Q;
	int A[10000], D[10000], X[10000];
	scanf("%d %d %d", &N, &T, &Q);
	for (int i = 1; i <= N; i++) {
		scanf("%d %d", &A[i], &D[i]);
		if (D[i] == 2) D[i] = -1;
	}
	for (int i = 1; i <= Q; i++) {
		scanf("%d", &X[i]);
	}
	for (int i = 1; i <= T; i++) {
		for (int j = 1; j <= N; j++) {
			A[j] += D[j];
			if (A[j] == A[j - 1]) {
				D[j] = 0;
				D[j - 1] = 0;
			}
			if (A[j] == A[j + 1]) {
				D[j] = 0;
				D[j + 1] = 0;
			}
		}
	}
	for (int i = 1; i <= Q; i++) {
		printf("%d\n", A[X[i]]);
	}
	
	return 0;
}

int factorial(int n) {
	if (n > 0) {
		return n * factorial(n - 1);
	}
	else {
		return 1;
	}
}
int sum(int n, int *all) {
	int total = 0;
	for (int i = 0; i < n; ++i) {
		total += all[i];
	}
	return total;
}
int ave(int n, int *all) {
	int total = 0;
	for (int i = 0; i<n; ++i) {
		total += all[i];
	}
	return total / n;
}
int min(int n, int *all) {
	int min = all[0];
	for (int i = 1; i < n; ++i) {
		if (min > all[i]) {
			min = all[i];
		}
	}
	return min;
}
int max(int n, int *all) {
	int max = all[0];
	for (int i = 1; i<n; ++i) {
		if (max<all[i]) {
			max = all[i];
		}
	}
	return max;
}
int max(int n, int m) {
	if (n >= m) {
		return n;
	}
	else {
		return m;
	}
}
int min(int n, int m) {
	if (n >= m) {
		return m;
	}
	else {
		return n;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'scanf' was not declared in this scope
   16 |         scanf("%d %d %d", &N, &T, &Q);
      |         ^~~~~
a.cc:38:17: error: 'printf' was not declared in this scope
   38 |                 printf("%d\n", A[X[i]]);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | void swap(int* x, int* y) {
Language: C++

#include<stdio.h>


int main() {
	int N, T, Q, flag = 0;
	long int A[10000], D[10000], X[10000];
	scanf("%d %d %d", &N, &T, &Q);
	for (int i = 1; i <= N; i++) {
		scanf("%d %d", &A[i], &D[i]);
	}
	for (int i = 1; i <= Q; i++) {
		scanf("%d", &X[i]);
	}
	for (int i = 1; i <= Q; i++) {
		if (D[X[i]] == 1) {
			for (int j = X[i]+1; j <= N;j++) {
				if (D[j] == 2) {
					if ((A[j-1] + A[j]) / 2 <= A[X[i]] + T) {
						printf("%ld\n", (A[j-1] + A[j]) / 2);
						flag = 1;
					}
					break;
				}
			}
			if (flag == 0) {
				printf("%ld\n", A[X[i]] + T);
			}
		}
		if (D[X[i]] == 2) {
			for (int j = X[i] -1; j >=1; j--) {
				if (D[j] == 1) {
					if ((A[j+1] + A[j]) / 2 >= A[X[i]] - T) {
						printf("%ld\n", (A[j+1] + A[j]) / 2);
						flag = 1;
					}
					break;
				}
			}
			if (flag == 0) {
				printf("%ld\n", A[X[i]] - T);
			}
	    }
		flag = 0;
    }
	return 0;

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

#include<stdio.h>


int main() {
	int N, T, Q, flag = 0;
	long int A[100000], D[100000], X[100000];
	scanf("%d %d %d", &N, &T, &Q);
	for (int i = 1; i <= N; i++) {
		scanf("%d %d", &A[i], &D[i]);
	}
	for (int i = 1; i <= Q; i++) {
		scanf("%d", &X[i]);
	}
	for (int i = 1; i <= Q; i++) {
		if (D[X[i]] == 1) {
			for (int j = X[i]+1; j <= N;j++) {
				if (D[j] == 2) {
					if ((A[j-1] + A[j]) / 2 <= A[X[i]] + T) {
						printf("%d\n", (A[j-1] + A[j]) / 2);
						flag = 1;
					}
					break;
				}
			}
			if (flag == 0) {
				printf("%d\n", A[X[i]] + T);
			}
		}
		if (D[X[i]] == 2) {
			for (int j = X[i] -1; j >=1; j--) {
				if (D[j] == 1) {
					if ((A[j+1] + A[j]) / 2 >= A[X[i]] - T) {
						printf("%d\n", (A[j+1] + A[j]) / 2);
						flag = 1;
					}
					break;
				}
			}
			if (flag == 0) {
				printf("%d\n", A[X[i]] - T);
			}
	    }
		flag = 0;
    }
	return 0;

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

//Zombie Island
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

static const int MAX = 100000;

int N, M, S, K, P, Q;

enum {
    SAFE,
    DENGEROUS,
    ZOMBIE
};

struct City {
    int state = SAFE;
    vector<int> adj;
};

City C[MAX + 1];
int d[MAX + 1];
bool visited[MAX + 1];

void setState(int t) {
    queue<pair<int, int> > Queue;
    for(int i = 0; i < MAX + 1; i++) visited[i] = false;
    Queue.push(make_pair(t, 0));
    visited[t] = true;
    while(!Queue.empty()) {
        pair<int, int> p = Queue.front();
        Queue.pop();
        if(p.first != t && C[p.first].state == ZOMBIE) continue;
        if(C[p.first].state == SAFE) C[p.first].state = DENGEROUS;
        if(p.second == S) continue;
        for(auto i: C[p.first].adj) {
            if(!visited[i]) {
                Queue.push(make_pair(i, p.second + 1));
                visited[i] = true;
            }
        }
    }
}

int dijkstra() {
    priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > PQ;
    for(int i = 0; i < MAX + 1; i++) d[i] = INT_MAX;
    PQ.push(make_pair(0, 1));
    d[1] = 0;
    int ans = INT_MAX;
    while(!PQ.empty()) {
        pair<int, int> p = PQ.top();
        PQ.pop();
        for(auto i: C[p.second].adj) {
            if(i == N) {
                if(d[i] > p.first) d[i] = p.first;
            } else if(C[i].state == SAFE) {
                if(d[i] > p.first + P) {
                    d[i] = p.first + P;
                    PQ.push(make_pair(p.first + P, i));
                }
            } else {
                if(d[i] > p.first + Q) {
                    d[i] = p.first + Q;
                    PQ.push(make_pair(p.first + Q, i));
                }
            }
        }
    }
    return d[N];
}

int main() {
    cin >> N >> M >> S >> K >> P >> Q;

    int c;
    int zombie_city[K];
    for(int i = 0; i < K; i++) {
        cin >> c;
        zombie_city[i] = c;
        C[c].state = ZOMBIE;
    }
    int a, b;
    for(int i = 0; i < M; i++) {
        cin >> a >> b;
        C[a].adj.push_back(b);
        C[b].adj.push_back(a);
    }

    for(int i = 0; i < K; i++) {
        setState(zombie_city[i]);
    }

    cout << dijkstra() << endl;
}


Compiler output:
a.cc: In function 'int dijkstra()':
a.cc:49:45: error: 'INT_MAX' was not declared in this scope
   49 |     for(int i = 0; i < MAX + 1; i++) d[i] = 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 | 
a.cc:52:15: error: 'INT_MAX' was not declared in this scope
   52 |     int ans = INT_MAX;
      |               ^~~~~~~
a.cc:52:15: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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

int n,m,k,s,p,q,a=INT_MAX;
set<int>c;
set<int>bad;
vector<int>G[100002];
bool visited[100002];
void dfs(int node,int cost){
    for(int i=0;i<G[node].size();i++){
        if(!visited[G[node][i]]&&!bad.count(G[node][i])){
            int co;
            if(c.count(G[node][i])){
                co=q;
            } else {
                co=p;
            }
            if(G[node][i]==n){
                a=min(a,cost);
               // cout<<cost<<endl;
                return;
            }
            visited[G[node][i]]=1;
            dfs(G[node][i],cost+co);
            //cout<<G[node][i]<<" "<<cost+co<<endl;
            visited[G[node][i]]=0;
        }
    }
}

int main(){
    memset(visited,0,sizeof(visited));
    cin>>n>>m>>k>>s>>p>>q;
    queue<pair<int,int> >cq;
    for(int i=0;i<k;i++){
        int c_;
        cin>>c_;
        c.insert(c_);
        bad.insert(c_);
        cq.push(make_pair(c_,0));
    }
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    while(cq.size()){
        set<int>bfs;
        pair<int,int>pa=cq.front();
        cq.pop();
        if(bfs.count(pa.first)||pa.second>s){
            continue;
        } else {
            c.insert(pa.first);
            bfs.insert(pa.first);
            if(pa.second+1<=s)
                for(int i=0;i<G[pa.first].size();i++){
                    if(!bfs.count(G[pa.first][i])){
                        cq.push(make_pair(G[pa.first][i], pa.second+1));
                    }
                }
        }
    }
//    for(set<int>::iterator it=c.begin();it!=c.end();it++){
//        cout<<*it<<endl;
//    }
    dfs(1,0);
    cout<<a<<endl;
}

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

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

#define INF 1152921504606846976

int N, M, K, S;
int P, Q;
vector<int> path[100010];
long long cost[100010][100010];
bool ng[100010];
bool dangerous[100010];

int dijkstra() {
  vector<bool> used(N, false);
  vector<long long> d(N, INF);
  d[0] = 0;

  while (true) {
    int v = -1;
    for (int u=0; u<N; u++) {
      if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
    }
    if (v == -1) break;
    used[v] = true;

    for (int u=0; u<N; u++) {
      d[u] = min(d[u], d[v] + cost[v][u]);
    }
  }
  return d[N-1];
}

int main() {
  cin >> N >> M >> K >> S;
  cin >> P >> Q;

  // init cost
  for (int i=0; i<N; i++) {
    for (int j=0; j<N; j++) {
      cost[i][j] = INF;
    }
  }

  queue<int> q;

  for (int i=0; i<K; i++) {
    int c;
    cin >> c;
    dangerous[c-1] = true;
    ng[c-1] = true;
    q.push(c-1);
    q.push(S);
  }
  for (int i=0; i<M; i++) {
    int a, b;
    cin >> a >> b;
    path[a-1].push_back(b-1);
    path[b-1].push_back(a-1);
  }
  // bfs
  vector<int> used(N, -1);
  while (!q.empty()) {
    int x = q.front(); q.pop();
    int r = q.front(); q.pop();
    if (r <= 0) continue;

    for (auto d : path[x]) {
      if (r <= used[d]) continue;
      dangerous[d] = true;
      used[d] = r;
      q.push(d);
      q.push(r-1);
    }
  }
  for (int i=0; i<N; i++) {
    for (auto d : path[i]) {
      if (ng[i] || ng[d]) continue;
      if (d == N-1) cost[i][d] = 0;
      else {
        if (dangerous[d]) cost[i][d] = Q;
        else              cost[i][d] = P;
      }
    }
  }

  cout << dijkstra() << "\n";
  return 0;
}

Compiler output:
/tmp/ccpOYxoO.o: in function `main':
a.cc:(.text+0x423): relocation truncated to fit: R_X86_64_PC32 against symbol `dangerous' defined in .bss section in /tmp/ccpOYxoO.o
a.cc:(.text+0x439): relocation truncated to fit: R_X86_64_PC32 against symbol `ng' defined in .bss section in /tmp/ccpOYxoO.o
a.cc:(.text+0x681): relocation truncated to fit: R_X86_64_PC32 against symbol `dangerous' defined in .bss section in /tmp/ccpOYxoO.o
a.cc:(.text+0x7a2): relocation truncated to fit: R_X86_64_PC32 against symbol `ng' defined in .bss section in /tmp/ccpOYxoO.o
a.cc:(.text+0x7ba): relocation truncated to fit: R_X86_64_PC32 against symbol `ng' defined in .bss section in /tmp/ccpOYxoO.o
a.cc:(.text+0x80e): relocation truncated to fit: R_X86_64_PC32 against symbol `dangerous' defined in .bss section in /tmp/ccpOYxoO.o
collect2: error: ld returned 1 exit status
Language: C++

#define _USE_MATH_DEFINES
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>

#define LLD long long int
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))
 


using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
const long long int INF=1001001001001001001;
int N,M,K,S;
////////
int P,Q;
bool C[100002];
///////
const int MAX_V=100002;
struct edge{ 
	int to,cost;
};
vector<edge> edges[MAX_V];//V??????????????????
LLD d[MAX_V];//???????????????????????¢


void dijkstra(int s){//?§????s??????????????????????????????????±???????
	priority_queue< pair<LLD,LLD> , vector< pair<LLD,LLD> > , greater<pair<LLD,LLD> > > que;
	memset(d,INF,sizeof(d) );//fill(d,d+V,INF);
	d[s]=0;
	que.push(make_pair(0,s) );

	while(!que.empty() ){
		pair<LLD,LLD> p=que.top(); que.pop();
		LLD v=p.sc;
		LLD cst=0;////cst->e.cost
		if( d[v] < p.first ) continue;
		if(v!=s){
			if(C[v])cst=Q;
			else cst=P;
		}////special
		rep(i,edges[v].size()){
			edge e=edges[v][i];
			if(d[e.to] > d[v]+cst){
				d[e.to]=d[v] + cst;
				que.push( make_pair(d[e.to], e.to ) );
			}
		}
	}
}


vector<int> Ks;
int main(){
	
	scanf("%d %d %d %d",&N,&M,&K,&S);
	fill(C,C+N,false);
	
	scanf("%d %d",&P,&Q);

	queue< pair<int,int> > kiken;
	rep(i,K){
		int k;
		scanf("%d",&k);
		k--;
		Ks.pb(k);
		kiken.push( mp(k,S) );
	}

	rep(i,M){
		int a,b;
		scanf("%d %d",&a,&b);
		a--;b--;
		edge e;
		e.to=b;e.cost=0;
		edges[a].pb(e);
		e.to=a;e.cost=0;
		edges[b].pb(e);
	}
	//??±?????????
	while(kiken.size()){
		pair<int,int> p=kiken.front();kiken.pop();
		C[p.fr]=true;
		if(p.sc==0)continue;
		rep(i,edges[p.fr].size() ){
			kiken.push( mp(edges[p.fr][i].to,p.sc-1) );
		}
	}
	rep(i,K){
		if(edges[Ks].siza())edges[Ks[i]].clear();
	}

	//dijkstra
	dijkstra(0);
	printf("%lld\n",d[N-1]);
}

Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:45:18: warning: overflow in conversion from 'long long int' to 'int' changes value from '1001001001001001001' to '1551474729' [-Woverflow]
   45 |         memset(d,INF,sizeof(d) );//fill(d,d+V,INF);
      |                  ^~~
a.cc: In function 'int main()':
a.cc:106:25: error: no match for 'operator[]' (operand types are 'std::vector<edge> [100002]' and 'std::vector<int>')
  106 |                 if(edges[Ks].siza())edges[Ks[i]].clear();
      |                         ^
Language: C++

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

using namespace std;
int c[200000];
int a[200000];
int b[200000];
int e[200000];
unsigned __int64 d[200000];
unsigned __int64 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.