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

#include <iostream>
using namespace std;

int T,N,K,X[100000+10],A[100000+10];
int tot=0;
int cut=0;
int main(){
	cin >> T;
	for(int t=0; t<T; ++t){
		cin >> N >> K;
		for(int i=0; i<N; ++i) cin >> X[i];
		for(int i=0; i+1<N; ++i){
			A[i]=X[i+1]-X[i];
			tot+=A[i];
		}
		sort(A,A+N-2); //????????????????????????
		reverse(A,A+N-2); //???????????\????????????
		for(int i=0; i<K; ++i) cut+=A[i]; //????????§????????????????????????????¨?
		cout << tot-cut << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |                 sort(A,A+N-2); //????????????????????????
      |                 ^~~~
      |                 short
a.cc:17:17: error: 'reverse' was not declared in this scope
   17 |                 reverse(A,A+N-2); //???????????\????????????
      |                 ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
int T=0, N=0, K=0, X[100000]={0}, A[100000]={0}, ans1=0;
int main(){
	cin >> T;
	for (int t=0; t<T; t++){
		cin >> N >> K;
		for (int i=0; i<N; i++) cin >> X[i];
		for (int i=0; i<N-1; i++) A[i] = X[i+1] - X[i];
		sort (A,A+N+1);
		reverse (A,A+N+1);
		for (int i=0; i<K-1; i++) ans1 += A[i];
		cout << X[N-1] - X[0] - ans1;
	}
	cout << endl;
}		

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |                 sort (A,A+N+1);
      |                 ^~~~
      |                 short
a.cc:11:17: error: 'reverse' was not declared in this scope
   11 |                 reverse (A,A+N+1);
      |                 ^~~~~~~
Language: C++

//
//AOJ 2104 Country Road
//date:20170417
//640009E
//Yang Bo
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>

using namespace std;

int main()
{
  int t = 0; //??????????????????????????°
  int n = 0, k = 0; //n:??¶????????°, k:?????????????????°

  cin >> t; //??????????????????????????°?????\???
  
  do {
    cin >> n >> k; //??¶????????°n??¨?????????????????°k?????\???
   
    //int a[n] = {0}; //??¶?????§?¨???????????????????
    vector<int> a(n);
    
    for(int i = 0; i < n; i++)
      cin >> a[i]; //??¶?????§?¨??????\???
    if(k>=n){
      cout<<"0\n";
      continue;
    } 
    //int m = n - 1;
    //int b[m] = {0}; //??¶??¨??¶??????????????¢??????????????????
    vector<int> b(n-1);
    for (int i = 0; i < n-1; i++)
      b[i] = a[i + 1] - a[i]; //??¶??¨??¶??????????????¢?????£??\
    
    sort(begin(b), end(b), greater<int>()); //?????¢???????????????????????????

    /*cout<<"DEBUG ";
    for(int i=0;i<n;i++)cout<<a[i]<<" ";
    for(int i=0;i<n-1;i++)cout<<b[i]<<" ";
    cout<<endl;
    */
    int ans = a[n - 1] - a[0]; //?????????????????????????????£??\
    for (int i = 0; i < k - 1; i++)
      ans = ans - b[i]; //????????????????????????????????????????????????
    
    cout << ans << '\n';
    
  } while (t-- > 0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:21: error: 'i' was not declared in this scope
   49 |       ans = ans - b[i]; //????????????????????????????????????????????????
      |                     ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>

using namespace std;

int main()
{
  int t = 0; //??????????????????????????°
  int n = 0, k = 0; //n:??¶????????°, k:?????????????????°

  cin >> t; //??????????????????????????°?????\???
  
  do {
    cin >> n >> k; //??¶????????°n??¨?????????????????°k?????\???
   
    //int a[n] = {0}; //??¶?????§?¨???????????????????
    vector<int> a(n);
    
    for(int i = 0; i < n; i++)
      cin >> a[i]; //??¶?????§?¨??????\???
    if(k>=n){
      cout<<"0\n";
      continue;
    } 

    vector<int> b(n-1);
    for (int i = 0; i < n-1; i++)
      b[i] = a[i + 1] - a[i]; //??¶??¨??¶??????????????¢?????£??\
    
    sort(begin(b), end(b), greater<int>()); //?????¢???????????????????????????

    int ans = a[n - 1] - a[0]; //?????????????????????????????£??\
    for (int i = 0; i < k - 1; i++)
      ans = ans - b[i]; //????????????????????????????????????????????????
    
    cout << ans << '\n';
    
  } while (t-- > 0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:21: error: 'i' was not declared in this scope
   36 |       ans = ans - b[i]; //????????????????????????????????????????????????
      |                     ^
Language: C++

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

using namespace std;

int main(){
  int t;

  cin>>t;

  for(int i=0;i<t;++i){
    int n,k;
    vector<int> x;
    vector<int> distance;
    int temp;
    int total=0;
    
    cin>>n>>k;

    for(int j=0;j<n;++j){
      cin>>temp;
      x.push_back(temp);
    }

    total=temp-x[0];
    
    for(int j=0;j<n-1;++j)
      distance.push_back(x[j+1]-x[j]);
      
    sort(distance.begin(),distance.end(),greater<int>());

    for(int j=0;j<k-1 && distance.length();++j)
      total-=distance[j];

    cout<<total<<endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:35: error: 'class std::vector<int>' has no member named 'length'
   33 |     for(int j=0;j<k-1 && distance.length();++j)
      |                                   ^~~~~~
Language: C++

using namespace std;

int main(){

  int t;

  cin>>t;
  
  for(int i=0;i<t;i++){

	int n,k;
	int sum=0;

	cin>>n>>k;

	vector<int> x(n);
	vector<int> dis;
	int n_k;

	n_k = n-k;

	for(int i=0;i<n;++i)
	  cin>>x[i];

	for(int i=0;i<n-1;++i)
	  dis.push_back(x[i+1]-x[i]);

	sort(dis.begin(),dis.end());
	
	for(int i=0;i<n_k;i++){

	  sum+=dis[i];
	  
	}

	cout<<sum;
	
  }
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>t;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:16:9: error: 'vector' was not declared in this scope
   16 |         vector<int> x(n);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:16:16: error: expected primary-expression before 'int'
   16 |         vector<int> x(n);
      |                ^~~
a.cc:17:16: error: expected primary-expression before 'int'
   17 |         vector<int> dis;
      |                ^~~
a.cc:23:16: error: 'x' was not declared in this scope
   23 |           cin>>x[i];
      |                ^
a.cc:26:11: error: 'dis' was not declared in this scope
   26 |           dis.push_back(x[i+1]-x[i]);
      |           ^~~
a.cc:26:25: error: 'x' was not declared in this scope
   26 |           dis.push_back(x[i+1]-x[i]);
      |                         ^
a.cc:28:14: error: 'dis' was not declared in this scope
   28 |         sort(dis.begin(),dis.end());
      |              ^~~
a.cc:28:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   28 |         sort(dis.begin(),dis.end());
      |         ^~~~
      |         short
a.cc:36:9: error: 'cout' was not declared in this scope
   36 |         cout<<sum;
      |         ^~~~
a.cc:36:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main() {
  int t, n, k;
  vector<int> x;
  vector<int> inter;
  int min_len;

  cin >> t;
  for(int i = 0; i < t; i++) {
    min_len = 0;
    cin >> n >> k;

    for(int j = 0; j < n; j++) {
      int X;
      cin >> X;
      x.push_back(X);
    }

    for(int j = 1; j < n; j++) {
      int I = x[j] - x[j-1];
      inter.push_back(I);
    }

    sort(inter.begin(), inter.end(), greater<inter>());

    for(int j = k-1; j < n-1; j++) {
      min_len += inter[j];
    }

    cout << min_len << endl;

    inter.clear();
    x.clear();
    big.clear();
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:51: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::greater'
   28 |     sort(inter.begin(), inter.end(), greater<inter>());
      |                                                   ^
a.cc:28:51: note:   expected a type, got 'inter'
a.cc:38:5: error: 'big' was not declared in this scope
   38 |     big.clear();
      |     ^~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int t,n,k,ans;
  int x[100000],d[100000];
  cin >> t;

  while(t--){
    cin >> n >> k;
    for(int i=0;i<n;i++){
      cin >> x[i];
      if(i)d[i-1] = x[i] - x[i-1];
    }
    if(n<=k)cout << 0 << endl;
    else{
      ans = x[n-1]-x[0];
      sort(d,d+n-1);

      int tmp = 1;
      while(k!=tmp)ans -= d[n-1-tmp++];
      cout << ans << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |       sort(d,d+n-1);
      |       ^~~~
      |       short
Language: C++

#include <iostream>
#include <algorithm>

int main() {
	int t;
	for ( int i=0; i<t; i++ ) {
		
		// 入力
		
		int n, k;
		std::cin >> n >> k ;
		int x[100000];
		for ( int j=0; j<n; j++ ) {
			std::cin >> x[j];
		}
		
		// 演算
		
		int a[100000];
		for ( int j=0; j<n-1; j++ ) {
			a[j] = x[j+1] - x[j];
		}
		
		sort( a, a+n-1 );
		
		int savedTotal=0;
		for ( int j=0: j<k-1; j++ ) {
			savedTotal += a[ n-1-j ];
		}
		
		// 出力
		
		std::cout << x[n-1] - x[0] - savedTotal << std::endl;
		
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   24 |                 sort( a, a+n-1 );
      |                 ^~~~
      |                 std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:27:28: error: initializer in range-based 'for' loop
   27 |                 for ( int j=0: j<k-1; j++ ) {
      |                            ^
a.cc:27:37: error: expected ')' before ';' token
   27 |                 for ( int j=0: j<k-1; j++ ) {
      |                     ~               ^
      |                                     )
a.cc:27:39: error: 'j' was not declared in this scope
   27 |                 for ( int j=0: j<k-1; j++ ) {
      |                                       ^
Language: C++

#include <iostream>
#include <algorithm>

int main() {
	int t;
	for ( int i=0; i<t; i++ ) {
		
		// 入力
		
		int n, k;
		std::cin >> n >> k ;
		int x[100000];
		for ( int j=0; j<n; j++ ) {
			std::cin >> x[j];
		}
		
		// 演算
		
		int a[100000];
		for ( int j=0; j<n-1; j++ ) {
			a[j] = x[j+1] - x[j];
		}
		
		std::sort( a, a+n-1 );
		
		int savedTotal=0;
		for ( int j=0: j<k-1; j++ ) {
			savedTotal += a[ n-1-j ];
		}
		
		// 出力
		
		std::cout << x[n-1] - x[0] - savedTotal << std::endl;
		
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:28: error: initializer in range-based 'for' loop
   27 |                 for ( int j=0: j<k-1; j++ ) {
      |                            ^
a.cc:27:37: error: expected ')' before ';' token
   27 |                 for ( int j=0: j<k-1; j++ ) {
      |                     ~               ^
      |                                     )
a.cc:27:39: error: 'j' was not declared in this scope
   27 |                 for ( int j=0: j<k-1; j++ ) {
      |                                       ^
Language: C++

#include <algorithm>
#include <iostream>
using namespace std;
int T,N,K,X[100000+10], A[100000+10];

int main(){
 cin >> T;
 for (int t=0; t<T; ++t){
  int Sum;
  cin >> N;
  cin >> K;
  for (int i=0; i<N; ++i)
    cin >> X[i];
  for (int i=0; i+1<N; ++i) A[i] = X[i+1]-X[i];
  sort(A,A+N-1);
  for (int i=0; i<(N-1-(K-1)); ++i)
  Sum += A[i];
  cout << Sum << endl;
  Sum = 0
  }
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: expected ';' before '}' token
   19 |   Sum = 0
      |          ^
      |          ;
   20 |   }
      |   ~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <string.h>
using namespace std;

long Gcd(long m, long n)
{
	long temp;
	while (m % n != 0)
	{
		temp = n;
		n = m % n;
		m = temp;
	}
	return n;
}

long Lcm(long m, long n)
{
	long g=Gcd(m,n);
	return m * n / g; 
}

const char *str="0123456789ABCDEF";

int f(char c0,char c1){
	const char *p0=strchr(str,c0);
	const char *p1=strchr(str,c1);
	return (p0-str)*16 + (p1-str);
}

int main() {
	int N;
	cin >> N;
	for(int i=0;i<N;i++){
		int n;
		cin >> n;
		vector<vector<unsigned char>> mm(n);
		string m;
		for(int j=0;j<n;j++){
			cin >> m;
			mm[j].reserve(m.length()/2);
			for(int k=0;k<m.length();k+=2){
				char c0=m[k];
				char c1=m[k+1];
				int num =f(c0,c1);
				mm[j].push_back(num);
//				cout << num << " ";
			}
//			cout << endl;
		}
//		int len=mm[0].size();
		for(int j=1;j<n;j++){
			len = Lcm(len,mm[j].size());
		}
		cout << len << endl;
		vector<unsigned char> ans(len,0);
		for(int j=0;j<n;j++){
			int g=len/mm[j].size();
			for(int k=0;k<mm[j].size();k++){
				ans[k*g]|=mm[j][k];
			}
		}
		int g=len;
		for(int j=1;j<len;j++){
			if(ans[j]!=0) g=Gcd(g,j);
		}
		if(len/g>1024){
			cout << "Too complex.";
		}else{
			for(int j=0;j<len;j+=g){
				int n0=ans[j]/16;
				int n1=ans[j]%16;
				cout << str[n0] << str[n1];
			}
		}
		cout << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:25: error: 'len' was not declared in this scope
   56 |                         len = Lcm(len,mm[j].size());
      |                         ^~~
a.cc:58:25: error: 'len' was not declared in this scope
   58 |                 cout << len << endl;
      |                         ^~~
Language: C++

#include<iostream>
#include<vector>
#include<queue>
using namespace std;
#include<iostream>
#include<cstdlib>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define fir first
#define sec second
#define pb  push_back
#define mp  make_pair

typedef long long ll;

const int N = 120;

int gcd(int a,int b){
  return b==0?a:gcd(b,a%b);
}

void minimize(vector<pair<int,ll> > &in,ll &num){
  int g=-1;
  if (in.size() == 1){
    if (in[0].sec == 0)return;
    g=gcd(in[0].sec,num);
    num/=g;
    in[0].sec/=g;
    return;
  }
  
  rep(j,in.size()){
    if (in[j].sec == 0);
    else if (g==-1)g=in[j].sec;
    else g=gcd(g,in[j].sec);
  }
  if (g>0){
    num/=g;
    rep(j,in.size())in[j].sec/=g;
  }
}

void solve(int n,vector<pair<int,ll> > *in,ll *num){
  int l=num[0];
  REP(i,1,n){
    l=l*num[i]/gcd(l,num[i]);
  }
  
  ll ansnum=l;
  rep(i,n){
    ll tmp=l/num[i];
    rep(j,in[i].size()){
      in[i][j].sec*=tmp;
    }
  }

  vector<pair<int,ll> > out2;
  rep(i,n){
    rep(k,in[i].size()){
      bool hassame=false;
      rep(j,out2.size()){
	if (out2[j].sec == in[i][k].sec){
	  out2[j].fir|=in[i][k].fir;
	  hassame=true;
	  break;
	}
      }
      if (!hassame)out2.pb(in[i][k]);
    }
  }

  minimize(out2,ansnum);

  if (ansnum > 1024){
    printf("Too complex.\n");
    return;
  }

  assert(ansnum>0);

  vector<int> out(ansnum,0);
  rep(i,out2.size()){
    out[out2[i].sec]=out2[i].fir;
  }

  rep(i,out.size())printf("%02X",out[i]);
  printf("\n");
}

void compute(int n,vector<pair<int,ll> > *in){

}


main(){
  int te;
  ll num[N];
  vector<pair<int,ll> > in[N];
  cin>>te;
  while(te--){
    int n;
    cin>>n;
    rep(i,n){
      in[i].clear();
      string inp;
      cin>>inp;
      num[i]=inp.size()/2;
      rep(j,inp.size()/2){
	if (inp[j*2]=='0'&&inp[j*2+1]=='0')continue;
	in[i].pb(mp(
		    (inp[j*2]-'0')*16+(inp[j*2+1]-'0'),
		    j
		    )
		 );
      }

      if (in[i].size() == 0)num[i]=1;
      minimize(in[i],num[i]);

      //cout <<"num " <<  num[i] << endl;
      //       rep(j,in[i].size()){
      // 	cout<<in[i][j].fir <<" " << in[i][j].sec << endl;
      //       }
      //       cout << endl;
    }
    solve(n,in,num);
  }
  return false;
}

Compiler output:
a.cc: In function 'void solve(int, std::vector<std::pair<int, long long int> >*, ll*)':
a.cc:80:3: error: 'assert' was not declared in this scope
   80 |   assert(ansnum>0);
      |   ^~~~~~
a.cc:7:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    6 | #include<cstdlib>
  +++ |+#include <cassert>
    7 | using namespace std;
a.cc: At global scope:
a.cc:96:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   96 | main(){
      | ^~~~
Language: C++

class in{struct It{int it;const bool rev;explicit constexpr It(int it_, bool rev=false):it(it_),rev(rev){}int operator*(){return it;}bool operator!=(It& r){return it!=r.it;}void operator++(){rev?--it:++it;}};const It i,n;public:explicit constexpr in(int n):i(0),n(n<0?0:n){}explicit constexpr in(int i,int n):i(i,n<i),n(n){}const It& begin(){return i;}const It& end(){return n;}};
  
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using mat = vector<bitset<50>>;

mat matMul(const mat& a, const mat& b) {
    const int n = a.size();
    mat c(n, bitset<50>(0));
    for(int i : in(n))
        for(int k : in(n))
            for(int j : in(n))
                c[i][j] = c[i][j] | (a[i][k] & b[k][j]);
    return c;
}
mat matPow(mat a, int k) {
    const int n = a.size();
    mat b(n, bitset<50>(0));
    for(int i : in(n)) b[i][i] = 1;
    while(k > 0) {
        if(k & 1) b = matMul(b, a);
        a = matMul(a, a);
        k >>= 1LL;
    }
    return b;
}
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m, k;
    while(cin >> n >> m >> k && n) {
        vector<pair<int, int>> edge;
        for(int _ : in(m)) {
            int u, v;
            cin >> u >> v;
            edge.emplace_back(u, v);
            edge.emplace_back(v, u);
        }
        m *= 2;
        vector<int> start, goal;
        mat e(m, bitset<50>(0));
        for(int i : in(m)) {
            int cur = edge[i].first, nxt = edge[i].second;
            if(cur == 1) start.emplace_back(i);
            if(nxt == n) goal.emplace_back(i);
            for(int j : in(m)) if(i != j)
                if(edge[j].first == nxt && edge[j].second != cur)
                    e[i][j] = 1;
        }
        e = matPow(e, k - 1);
        bool ok = false;
        for(int s : start)
            for(int g : goal)
                ok |= (e[s][g] == 1);
        cout << (ok ? "yes" : "no") << endl;
    }
    return 0;
}

Compiler output:
a.cc:7:20: error: 'bitset' was not declared in this scope
    7 | using mat = vector<bitset<50>>;
      |                    ^~~~~~
a.cc:6:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    5 | #include <algorithm>
  +++ |+#include <bitset>
    6 | using namespace std;
a.cc:7:27: error: template argument 1 is invalid
    7 | using mat = vector<bitset<50>>;
      |                           ^~
a.cc:7:27: error: template argument 2 is invalid
a.cc:9:1: error: 'mat' does not name a type
    9 | mat matMul(const mat& a, const mat& b) {
      | ^~~
a.cc:18:1: error: 'mat' does not name a type
   18 | mat matPow(mat a, int k) {
      | ^~~
a.cc: In function 'int main()':
a.cc:43:9: error: 'mat' was not declared in this scope
   43 |         mat e(m, bitset<50>(0));
      |         ^~~
a.cc:50:21: error: 'e' was not declared in this scope
   50 |                     e[i][j] = 1;
      |                     ^
a.cc:52:9: error: 'e' was not declared in this scope
   52 |         e = matPow(e, k - 1);
      |         ^
a.cc:52:13: error: 'matPow' was not declared in this scope
   52 |         e = matPow(e, k - 1);
      |             ^~~~~~
Language: C++

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

using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int,int> P;

mat mul(mat &A,mat &B){
  mat C(A.size(),vec(B[0].size()));
  for(int i=0;i<A.size();i++)
    for(int k=0;k<B.size();k++)
      for(int j=0;j<B[0].size();j++)
	C[i][j]+=A[i][k]*B[k][j];

  return C;
} 

mat pow(mat A,int n){
  mat B(A.size(),vec(A.size()));
  for(int i=0;i<A.size();i++)B[i][i]=1;
  for(;n>0;n>>=1){
    if(n&1)B=mul(B,A);
    A=mul(A,A);
  }
  return B;
}

int main(void){
  int n,m,z,s,d;

  while(cin >> n >> m >> z,n|m|z){
    vector<P>G;
    G.push_back(P(1,1));
    for(int i=0;i<m;i++){
      cin >> s >> d;
      G.push_back(P(s,d));
      G.push_back(P(d,s));
    }
    mat A(G.size(),vec(G.size()));
 
    for(int i=0;i<G.size();i++)
      for(int j=1;j<G.size();j++)
	if(i!=j && G[i].first!=G[j].second)
	  A[i][j]=G[i].second==G[j].first;

    A=pow(A,z);

    bool fg=false;
    for(int i=0;i<A.size();i++)
      if(G[i].s==n && A[0][i])fg=true;

    cout << (fg?"yes":"no") << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:15: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 's'
   53 |       if(G[i].s==n && A[0][i])fg=true;
      |               ^
Language: C

#include <iostream>
#include <cassert>
#include <complex>
#include <vector>
using namespace std;

//#pragma comment(linker, "/STACK:400000000")

#define EPS 1e-9
#define P complex<double>
#define L vector<P>
#define pb push_back
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define y1 Y1

int N,x1,y1,x2,y2,X,Y;

double cross(const P &a,const P &b){
    return imag(conj(a)*b);
}

P crosspoint(const L &l, const L &m) {
    double A = cross(l[1] - l[0], m[1] - m[0]);
    double B = cross(l[1] - l[0], l[1] - m[0]);
    if (abs(A) < EPS && abs(B) < EPS) return m[0];
    if (abs(A) < EPS) assert(false);
    return m[0] + B / A * (m[1] - m[0]);
}

bool online(int x1,int y1,int x2,int y2){
    return x1==x2 || y1==y2 || abs(x1-x2)==abs(y1-y2);
}

int main(){
	cin>>N;
    rep(tc,N){
        cin>>x1>>y1>>x2>>y2>>X>>Y;
        
        if(x1==X && y1==Y || x2==X && y2==Y){
            cout<<0<<endl;
            continue;
        }
        
        if(online(x1,y1,X,Y) && online(x2,y2,X,Y)){
            cout<<1<<endl;
            continue;
        }
        
        if(online(x1,y1,X,Y) || online(x2,y2,X,Y)){
            cout<<2<<endl;
            continue;
        }
        
        if(online(x1,y1,x2,y2)){
            cout<<3<<endl;
            continue;
        }
        
        P a(x1,y1),b(x2,y2);
        L l[4],m[4];
        l[0].pb(a); l[0].pb(a+P(1,0));
        l[1].pb(a); l[1].pb(a+P(1,1));
        l[2].pb(a); l[2].pb(a+P(0,1));
        l[3].pb(a); l[3].pb(a+P(-1,1));
        m[0].pb(b); m[0].pb(b+P(1,0));
        m[1].pb(b); m[1].pb(b+P(1,1));
        m[2].pb(b); m[2].pb(b+P(0,1));
        m[3].pb(b); m[3].pb(b+P(-1,1));
        
        rep(i,4)rep(j,4)if(i!=j){
            P p=crosspoint(l[i],m[j]);
            double x=p.real(), y=p.imag();
            int xx=x+EPS, yy=y+EPS;
            if(x-xx > 0.4)continue;
            if(online(xx,yy,X,Y)){
                cout<<3<<endl;
                goto end;
            }
        }
        
        cout<<4<<endl;
    end:;
    }
}

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

#include <iostream>
#include <cassert>
#include <complex>
#include <cstdlib>
#include <vector>
using namespace std;

#define EPS 1e-9
#define P complex<double>
#define L vector<P>
#define pb push_back
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define y1 Y1

int N,x1,y1,x2,y2,X,Y;

double cross(const P &a,const P &b){
    return imag(conj(a)*b);
}

P crosspoint(const L &l, const L &m) {
    double A = cross(l[1] - l[0], m[1] - m[0]);
    double B = cross(l[1] - l[0], l[1] - m[0]);
    if (abs(A) < EPS && abs(B) < EPS) return m[0];
    if (abs(A) < EPS) assert(false);
    return m[0] + B / A * (m[1] - m[0]);
}

bool online(int x1,int y1,int x2,int y2){
    return x1==x2 || y1==y2 || labs(x1-x2)==labs(y1-y2);
}

int main(){
	cin>>N;
    rep(tc,N){
        cin>>x1>>y1>>x2>>y2>>X>>Y;
        
        if(x1==X && y1==Y || x2==X && y2==Y){
            cout<<0<<endl;
            continue;
        }
        
        if(online(x1,y1,X,Y) && online(x2,y2,X,Y)){
            cout<<1<<endl;
            continue;
        }
        
        if(online(x1,y1,X,Y) || online(x2,y2,X,Y)){
            cout<<2<<endl;
            continue;
        }
        
        if(online(x1,y1,x2,y2)){
            cout<<3<<endl;
            continue;
        }
        
        P a(x1,y1),b(x2,y2);
        L l[4],m[4];
        l[0].pb(a); l[0].pb(a+P(1,0));
        l[1].pb(a); l[1].pb(a+P(1,1));
        l[2].pb(a); l[2].pb(a+P(0,1));
        l[3].pb(a); l[3].pb(a+P(-1,1));
        m[0].pb(b); m[0].pb(b+P(1,0));
        m[1].pb(b); m[1].pb(b+P(1,1));
        m[2].pb(b); m[2].pb(b+P(0,1));
        m[3].pb(b); m[3].pb(b+P(-1,1));
        
        rep(i,4)rep(j,4)if(i!=j){
            P p=crosspoint(l[i],m[j]);
            double x=p.real(), y=p.imag();
            int xx=floor(x+EPS), yy=floor(y+EPS);
            if(abs(x-xx) > 0.4)continue;
            if(online(xx,yy,X,Y)){
                cout<<3<<endl;
                goto end;
            }
        }
        
        cout<<4<<endl;
    end:;
    }
}

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

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

using namespace std;

#include "../geometry.h"

P input(){
    double x, y;
    cin >> x >> y;
    return {x, y};
}
namespace std{
    bool operator < (const P& a, const P& b) {
        return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag();
    }
};
const double INF = DBL_MAX;
vector<double> dijkstra(const Graph& G, int s){
    typedef pair<double, int> P;
    priority_queue<P, vector<P>, greater<P>> que;
    vector<double> res(G.size(), INF);
    que.push(P(0, s));
    res[s] = 0;
    while(!que.empty()){
        P p = que.top(); que.pop();
        int v = p.second;
        double c = p.first;
        if(c > res[v]) continue;
        for(auto& e : G[v]){
            if(res[e.dst] > res[v] + e.cost){
                res[e.dst] = res[v] + e.cost;
                que.push(P(res[e.dst], e.dst));
            }
        }
    }
    return res;
}
int main(){
    int N;
    int casenum = 0;
    while(cin >> N && N){
        P sp = input();
        P gp = input();

        vector<L> elec(N);
        REP(i, N) {
            P pa = input();
            P pb = input();
            elec[i] = {pa, pb};
        }

        vector<L> lines;
        bool exist_s = false;
        bool exist_g = false;
        REP(i, N) {
            P v = vec(elec[i]) * P(0, 1) / abs(vec(elec[i])) * 1e6;
            for(P p : {sp, gp}){
                L l = {p, p + v};
                if(iLS(l, elec[i])) {
                    if(p == sp) exist_s = true;
                    if(p == gp) exist_g = true;
                    lines.push_back(l);
                }
            }
            lines.push_back({elec[i][0] - v, elec[i][0] + v});
            lines.push_back({elec[i][1] - v, elec[i][1] + v});
        }

        if(!exist_s || !exist_g) {
            printf("Case %d: Impossible\n", ++casenum);
            continue;
        }

        vector<P> ps;
        Graph G = segment_arrangement(lines, ps);

        int start = lower_bound(ps.begin(), ps.end(), sp) - ps.begin();
        int goal = lower_bound(ps.begin(), ps.end(), gp) - ps.begin();
        assert(ps[start] == sp);
        assert(ps[goal] == gp);
        vector<double> dist = dijkstra(G, start);

        double res = dist[goal];

        if(res < INF) {
            printf("Case %d: %.5f\n", ++casenum, res);
        }else {
            printf("Case %d: Impossible\n", ++casenum);
        }

    }
    return 0;
}

Compiler output:
a.cc:6:10: fatal error: ../geometry.h: No such file or directory
    6 | #include "../geometry.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

using namespace std;

#include "../geometry.h"

P input(){
    double x, y;
    cin >> x >> y;
    return {x, y};
}
const double INF = DBL_MAX;
vector<double> dijkstra(const Graph& G, int s){
    typedef pair<double, int> P;
    priority_queue<P, vector<P>, greater<P>> que;
    vector<double> res(G.size(), INF);
    que.push(P(0, s));
    res[s] = 0;
    while(!que.empty()){
        P p = que.top(); que.pop();
        int v = p.second;
        double c = p.first;
        if(c > res[v]) continue;
        for(auto& e : G[v]){
            if(res[e.dst] > res[v] + e.cost){
                res[e.dst] = res[v] + e.cost;
                que.push(P(res[e.dst], e.dst));
            }
        }
    }
    return res;
}
int main(){
    int N;
    int casenum = 0;
    while(cin >> N && N){
        P sp = input();
        P gp = input();

        vector<L> elec(N);
        REP(i, N) {
            P pa = input();
            P pb = input();
            elec[i] = {pa, pb};
        }

        vector<L> lines;
        bool exist_s = false;
        bool exist_g = false;
        REP(i, N) {
            P v = vec(elec[i]) * P(0, 1) / abs(vec(elec[i])) * 1e6;
            for(P p : {sp, gp}){
                L l = {p, p + v};
                if(iLS(l, elec[i])) {
                    if(p == sp) exist_s = true;
                    if(p == gp) exist_g = true;
                    lines.push_back(l);
                }
            }
            lines.push_back({elec[i][0] - v, elec[i][0] + v});
            lines.push_back({elec[i][1] - v, elec[i][1] + v});
        }

        if(!exist_s || !exist_g) {
            printf("Case %d: Impossible\n", ++casenum);
            continue;
        }

        vector<P> ps = {sp, gp};
        merge_segments(lines);
        Graph G = segment_arrangement(lines, ps);

        int start = lower_bound(ps.begin(), ps.end(), sp) - ps.begin();
        int goal = lower_bound(ps.begin(), ps.end(), gp) - ps.begin();
        assert(ps[start] == sp);
        assert(ps[goal] == gp);
        vector<double> dist = dijkstra(G, start);

        double res = dist[goal];

        if(res < INF) {
            printf("Case %d: %.5f\n", ++casenum, res);
        }else {
            printf("Case %d: Impossible\n", ++casenum);
        }

    }
    return 0;
}

Compiler output:
a.cc:6:10: fatal error: ../geometry.h: No such file or directory
    6 | #include "../geometry.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int n; double sx[16], sy[16], tx[16], ty[16], dp[1 << 14][14][2];
double dst(double ax, double ay, double bx, double by) {
	return sqrtl((ax - bx)*(ax - bx) + (ay - by)*(ay - by));
}
int main() {
	int d = 0;
	while (true) {
		cin >> n; if (n == 0)break; long double ret = 0; d++;
		cout << "Case " << d << ": ";
		for (int i = 0; i < n; i++) { cin >> sx[i] >> sy[i] >> tx[i] >> ty[i]; ret += dst(sx[i], sy[i], tx[i], ty[i]); }
		for (int i = 0; i < (1 << n); i++) { for (int j = 0; j < n; j++) { dp[i][j][0] = 1e10; dp[i][j][1] = 1e10; } }
		for (int i = 0; i < n; i++) { dp[1 << i][i][0] = 0; dp[1 << i][i][1] = 0; }
		for (int i = 0; i < (1 << n); i++) {
			for (int j = 0; j < n; j++) {
				if (dp[i][j][0] <= 1e9) {
					for (int k = 0; k < n; k++) {
						if ((i&(1 << k)) != 0)continue;
						dp[i + (1 << k)][k][0] = min(dp[i + (1 << k)][k][0], dp[i][j][0] + dst(tx[j], ty[j], sx[k], sy[k]));
						dp[i + (1 << k)][k][1] = min(dp[i + (1 << k)][k][1], dp[i][j][0] + dst(tx[j], ty[j], tx[k], ty[k]));
					}
				}
				if (dp[i][j][1] <= 1e9) {
					for (int k = 0; k < n; k++) {
						if ((i&(1 << k)) != 0)continue;
						dp[i + (1 << k)][k][0] = min(dp[i + (1 << k)][k][0], dp[i][j][1] + dst(sx[j], sy[j], sx[k], sy[k]));
						dp[i + (1 << k)][k][1] = min(dp[i + (1 << k)][k][1], dp[i][j][1] + dst(sx[j], sy[j], tx[k], ty[k]));
					}
				}
			}
		}
		double minx = 1e10; for (int i = 0; i < n; i++) { minx = min(minx, min(dp[(1 << n) - 1][i][0], dp[(1 << n) - 1][i][1])); }
		printf("%.5lf\n", minx + ret);
	}
	return 0;
}

Compiler output:
a.cc: In function 'double dst(double, double, double, double)':
a.cc:6:16: error: 'sqrtl' was not declared in this scope; did you mean 'strtol'?
    6 |         return sqrtl((ax - bx)*(ax - bx) + (ay - by)*(ay - by));
      |                ^~~~~
      |                strtol
Language: C++


#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>

using namespace std;

int main() {
    for(int C = 1; ; ++C) {
        int N, W;
        cin >> N >> W;
        if(!N && !W) break;

        vector<int> ws(N);
        for(int i = 0; i < N; ++i) cin >> ws[i];

        vector<vector<int> > sv(N, vector<int>(N, 0));
        for(int i = 0; i < N; ++i) {
            int sum = 0;
            for(int j = i; j < N; ++j) {
                sum += ws[j];
                sv[i][j] = sum;
            }
        }
        vector<vector<int> > cv(N, vector<int>(N, 0));
        for(int i = 0; i < N; ++i) {
            int sum = 0;
            for(int j = i; j < N; ++j) {
                sum += ws[j];
                cv[i][j] = abs(sum-W);
            }
        }

        vector<int> dp(N, INT_MAX);
        dp[0] = cv[0][0];
        for(int i = 1; i < N-1; ++i) {
            dp[i] = cv[0][i];
            for(int j = 0; j < i; ++j) {
                dp[i] = min(dp[i], dp[j]+cv[j+1][i]);
            }
        }
        dp[i] = max(0, cv[0][N-1]-W);
        for(int i = 0; i < N-1; ++i) dp[N-1] = min(dp[N-1], dp[i] + max(0, sv[i+1][N-1]-W));

        cout << "Case " << C << ": " << dp[N-1] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:12: error: 'i' was not declared in this scope
   43 |         dp[i] = max(0, cv[0][N-1]-W);
      |            ^
Language: C

#include <iostream>
#include <cstring>

using namespace std;

const int dx[] = { 1, 0, -1, 0 };
const int dy[] = { 0, 1, 0, -1 };
bool field[201][201];

int main(){
	while(true){
		int W, H, N;
		cin >> W >> H >> N;
		if(W == 0 && H == 0 && N == 0){ break; }
		memset(field, 0, sizeof(field));
		for(int i = 0; i <= H * 2; ++i){
			field[i][0] = field[i][W * 2] = true;
		}
		for(int i = 0; i <= W * 2; ++i){
			field[0][i] = field[H * 2][i] = true;
		}
		while(N--){
			int x1, y1, x2, y2;
			cin >> x1 >> y1 >> x2 >> y2;
			if(x1 != x2){
				if(x2 < x1){ swap(x1, x2); }
				for(int i = x1 * 2; i <= x2 * 2; ++i){
					field[y1 * 2][i] = true;
				}
			}else{
				if(y2 < y1){ swap(y1, y2); }
				for(int i = y1 * 2; i <= y2 * 2; ++i){
					field[i][x1 * 2] = true;
				}
			}
		}
		int xe1, ye1, xe2, ye2, xg, yg, xs, ys;
		cin >> xe1 >> ye1 >> xe2 >> ye2 >> xg >> yg;
		xg = xg * 2 + 1; yg = yg * 2 + 1;
		int dir = 0;
		if(xe1 != xe2){
			xs = min(xe1, xe2) * 2 + 1;
			if(ye1 == 0){
				ys = 0;
				dir = 1;
			}else{
				ys = (H * 2);
				dir = 3;
			}
		}else{
			ys = min(ye1, ye2) * 2 + 1;
			if(xe1 == 0){
				xs = 0;
				dir = 0;
			}else{
				xs = (W * 2);
				dir = 2;
			}
		}
		field[ys][xs] = false;
		int x = xs, y = ys, answer = 0;
		while(true){
			int nx = x + dx[dir], ny = y + dy[dir];
			while(field[ny][nx]){
				dir = (dir - 1) & 3;
				nx = x + dx[dir], ny = y + dy[dir];
			}
			if(!field[ny + dy[(dir + 1) & 3]][nx + dx[(dir + 1) & 3]]){
				dir = (dir + 1) & 3;
			}
			x = nx; y = ny;
			if((x & 1) == 1 && (y & 1) == 1){ ++answer; }
			if(x == xs && y == ys){
				answer = -1;
				break;
			}else if(x == xg && y == yg){
				break;
			}
		}
		if(answer < 0){
			cout << "Impossible" << endl;
		}else{
			cout << answer << endl;
		}
	}
	return 0;
}

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

#include<cstdio>
#include<cstdlib>
#include<iostream>
 
using namespace std;

/* constant */

const int MAX_W = 100;
const int MAX_H = 100;

const int dxs[] = {1, 0, -1, 0};
const int dys[] = {0, 1, 0, -1};

/* typedef */

/* global variables */

int w, h, n;
bool wls[MAX_H][MAX_W][4], vstd[MAX_H][MAX_W][4];

/* subroutines */

/* main */

int main() {
  for (;;) {
    cin >> w >> h >> n;
    if (w == 0) break;
    
    memset(wls, 0, sizeof(wls));
    memset(vstd, 0, sizeof(vstd));

    for (int i = 0; i < n; i++) {
      int x0, y0, x1, y1;
      cin >> x0 >> y0 >> x1 >> y1;

      if (y0 == y1) {
	if (x0 > x1) swap(x0, x1);
	for (int x = x0; x < x1; x++) {
	  if (y0 > 0) wls[y0 - 1][x][1] = true;
	  if (y0 < h) wls[y0][x][3] = true;
	}
      }
      else {
	if (y0 > y1) swap(y0, y1);
	for (int y = y0; y < y1; y++) {
	  if (x0 > 0) wls[y][x0 - 1][0] = true;
	  if (x0 < w) wls[y][x0][2] = true;
	}
      }
    }

    for (int x = 0; x < w; x++) wls[0][x][3] = wls[h - 1][x][1] = true;
    for (int y = 0; y < h; y++) wls[y][0][2] = wls[y][w - 1][0] = true;
    
    int x, y, x1, y1, gx, gy, left;
    cin >> x >> y >> x1 >> y1 >> gx >> gy;

    if (y == y1) {
      if (x > x1) swap(x, x1);
      if (y == 0) left = 2;
      else y--, left = 0;
    }
    else {
      if (y > y1) swap(y, y1);
      if (x == 0) left = 1;
      else x--, left = 3;
    }

    int d;
    for (d = 1; x != gx || y != gy; d++) {
      //printf("x=%d, y=%d, left=%d\n", x, y, left);
      
      if (vstd[y][x][left]) {
	d = -1;
	break;
      }

      vstd[y][x][left] = true;
      
      int drc = (left + 3) % 4;
      if (wls[y][x][left]) {
	while (wls[y][x][drc])
	  drc = (drc + 3) % 4, left = (drc + 1) % 4;
      }
      else {
	drc = left;
	left = (left + 1) % 4;
      }

      x += dxs[drc];
      y += dys[drc];
    }

    if (d < 0) cout << "Impossible" << endl;
    else cout << d << endl;
  }

  return 0;
}

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


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

struct Person{int x,y,dir;};
enum Mapchip{BLANK,WALL,ENTRANCE,EXIT};
enum Direction{UP,RIGHT,DOWN,LEFT};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
Person me;
int v[205][205];

int move(Person me);
Person turn(Person me, int dir);

bool operator<(Person a, Person b)
{
  return a.x!=b.x?a.x<b.x:(a.y!=b.y?a.y<b.y:a.dir<b.dir);
}

int move(Person me)
{
  bool visited[205][205][4]={0};
  int dist=1;
  while(1){
    Person next=me;
    next.x+=dx[me.dir];
    next.y+=dy[me.dir];
    dist++;

    if(visited[next.x][next.y][next.dir]){
      dist=-1;
      break;
    }
    if(v[next.x][next.y]==EXIT)break;
    if(v[next.x][next.y]==ENTRANCE){
      dist=-1;
      break;
    }
    if(v[next.x][next.y]==BLANK && v[next.x+dx[(next.dir+3)%4]][next.y+dy[(next.dir+3)%4]]==WALL){
      me=next;
      visited[me.x][me.y][me.dir]=true;
      continue;
    }
    if(v[next.x][next.y]==BLANK && v[next.x+dx[(next.dir+3)%4]][next.y+dy[(next.dir+3)%4]]!=WALL && v[me.x+dx[(me.dir+3)%4]][me.y+dy[(me.dir+3)%4]]==WALL){
      next=turn(next,LEFT);
      next.x+=dx[next.dir];
      next.y+=dy[next.dir];
      dist++;
      me=next;
      visited[me.x][me.y][me.dir]=true;
      if(v[next.x][next.y]==EXIT)break;
      if(v[next.x][next.y]==ENTRANCE){
        dist=-1;
        break;
      }
      continue;
    }
    if(v[next.x][next.y]==WALL){
      me=turn(me,RIGHT);
      visited[me.x][me.y][me.dir]=true;
      dist--;
      continue;
    }
  }
  return dist;
}
Person turn(Person me, int dir)
{
  if(dir==RIGHT)me.dir=(me.dir+1)%4;
  if(dir==LEFT)me.dir=(me.dir+3)%4;
  return me;
}

int main()
{
  int W,H,N,x1,y1,x2,y2,xe1,ye1,xe2,ye2,xx,yx;
  int i,j;
  while(cin>>W>>H>>N,W|H|N){
    W = 2*W+1;
    H = 2*H+1;
    for(i=0;i<W;i++)for(j=0;j<H;j++)v[i][j]=BLANK;
    for(i=0;i<W;i++){
      v[i][0]=WALL;
      v[i][H-1]=WALL;
    }
    for(j=0;j<H;j++){
      v[0][j]=WALL;
      v[W-1][j]=WALL;
    }

    while(N-->0){
      cin>>x1>>y1>>x2>>y2;
      x1*=2; y1*=2;
      x2*=2; y2*=2;
      if(x1==x2 && y1>=y2)swap(y1,y2);
      if(x1>=x2 && y1==y2)swap(x1,x2);
      for(i=x1;i<=x2;i++)for(j=y1;j<=y2;j++)v[i][j]=WALL;
    }
    cin>>xe1>>ye1>>xe2>>ye2>>xx>>yx;
    xe1*=2; ye1*=2; xe2*=2; ye2*=2;
    xx = 2*xx+1; yx = 2*yx+1;

    if(xe1==xe2){
      me.x=xe1;
      me.y=ye1+1;
      if(x1==0){
        me.dir=RIGHT;
      }
      if(x1==W-1){
        me.dir=LEFT;
      }
    }
    if(ye1==ye2){
      me.x=xe1+1;
      me.y=ye1;
      if(y1==0){
        me.dir=UP;
      }
      if(y1==H-1){
        me.dir=DOWN;
      }
    }
    v[me.x][me.y]=ENTRANCE;
    v[xx][yx]=EXIT;

    int t=move(me);
    if(t!=-1)printf("%d\n",t/2);
    else puts("impossible");
  }
}

Compiler output:
a.cc:3:9: fatal error: stdio: No such file or directory
    3 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: Java

import java.util.BitSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Scanner;

@unchecked
public class Main {

	Scanner sc;

	Main() {
		sc = new Scanner(System.in);
	}

	class st implements Comparable<st> {
		int cost;
		int pos;
		int omit;

		st(int cost, int pos, int omit) {
			this.cost = cost;
			this.pos = pos;
			this.omit = omit;
		}

		public int compareTo(st tar) {
			return cost - tar.cost;
		}
	}

	void run() {
		for (;;) {
			int n = sc.nextInt();

			if (n == 0) {
				break;
			}
			n++;
			int s = sc.nextInt();
			int t = sc.nextInt();
			int m = sc.nextInt();

			LinkedList<Integer>[] dir = new LinkedList[n];
			LinkedList<Integer>[] rev = new LinkedList[n];
			for (int i = 0; i < n; i++) {
				dir[i] = new LinkedList<Integer>();
				rev[i] = new LinkedList<Integer>();
			}

			for (int i = 0; i < m; i++) {
				int a = sc.nextInt();
				int b = sc.nextInt();
				dir[a].add(b);
				rev[b].add(a + (i+1) * n);
			}

			BitSet u = new BitSet(n * (m+1));
			PriorityQueue<st> q = new PriorityQueue<st>();
			q.add(new st(0, s, 0));
			for (;;) {
				if (q.isEmpty()) {
					System.err.println("Impossible");
					break;
				}

				st now = q.poll();
				int v = now.pos + now.omit * n;
				if (u.get(v)) {
					continue;
				}
				if (now.pos == t) {
					System.out.println(now.cost + " " + now.omit);
					break;
				}
				u.set(v);

				for (int next : dir[now.pos]) {
					if (!u.get(next + now.omit * n)) {
						q.add(new st(now.cost + 1, next, now.omit));
					}
				}
				if (now.omit == 0) {
					for (int next : rev[now.pos]) {
						if (!u.get(next)) {
							q.add(new st(now.cost + 1, next % n, next / n));
						}
					}
				}
			}

		}
	}

	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}

}

Compiler output:
Main.java:6: error: cannot find symbol
@unchecked
 ^
  symbol: class unchecked
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

import java.util.*;

public class A {
	// N A B C X
	// Y1 Y2 ... YN 
	// x' = (A テδ?x + B) mod C
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n, a, b, c, x;
		
		while(true){
			// ティツェツュテ」ツ?ソテ・ツ渉姪」ツつ?
			n = in.nextInt();
			a = in.nextInt();
			b = in.nextInt();
			c = in.nextInt();
			x = in.nextInt();
			
			if(n == 0 && a == 0 && b == 0 && c == 0 && x == 0) break;
			
			int[] y = new int[n];
			for(int i=0;i<n;i++){
				y[i] = in.nextInt();
			}
			
			System.out.println(solve(n,a,b,c,x,y));
		}
	}

	static int solve(int n, int a, int b, int c, int x, int[] y){
		int count = 0; // frameテヲツ閉ー
		
		if(n==1 && y[0]==x) return 0;
		
		for(int i=0;i<n;i++){
			while(true){ 
				//System.out.println("i="+i+" x="+x+" count="+count);
				if(count>10000 || y[i]==x){
					x = (a*x+b)%c; if(i+1 < n)count++; // テヲツャツ。テ」ツ?ォティツ。ツ古」ツ?湘」ツ?淌」ツつ?」ツ?ョテ・ツ?ヲテァツ青?
					break;
				}
				count++;
				x = (a*x+b)%c;
			}
		}
		
		return (count > 10000 ? -1 : count);
	}
}

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

import java.util.*;

class Main{

    int N,A,B,C;
    int[] Y;

    void solve(){
	Scanner sc = new Scanner(System.in);

	while(true){  
	    N = sc.nextInt();
	    A = sc.nextInt();
	    B = sc.nextInt();
	    C = sc.nextInt();
	    int X = sc.nextInt();
	    if(N==0 && A==0 && B==0 && C==0 && X==0) break;

	    Y = new int[N];
	    for(int i=0; i<N; i++) Y[i] = sc.nextInt();

	    int cnt = 0;
	    boolean notFound = false;
	    for(int i=0; i<N; i++){
		while(true){
		    cnt++;
		    if(X==Y[i]){
			X = (A*X+B)%C;
			break;
		    }
		    X = (A*X+B)%C;

		    if(cnt>10000){
			notFound = true;
			break;
		    }
		}
	    }

	    if(notFound) System.out.println(-1);
	    else System.out.println(cnt-1);
	}
    }

    public static void main(String[] args){
	new A2009().solve();
    }
}

Compiler output:
Main.java:46: error: cannot find symbol
	new A2009().solve();
	    ^
  symbol:   class A2009
  location: class Main
1 error
Language: C

main(n,a,b,c,x,i,t,y[101]){ ;for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}return 0;}

Compiler output:
main.c:1:21: error: expected ')' before '[' token
    1 | main(n,a,b,c,x,i,t,y[101]){ ;for(;scanf("%d%d%d%d%d",&n,&a,&b,&c,&x),n;printf("%d\n",t>10000?-1:t)){for(i=0;i<n;)scanf("%d",y+i++);for(t=i=0;t<10001&i<n;x=(a*x+b)%c,t++)if(y[i]==x&&++i==n)break;}return 0;}
      |                     ^
      |                     )
Language: C

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

using namespace std;

inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}

typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iretator i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

const double EPS = 1e-10;

int main() {
	int N, A, B, C, X, i, n, nn, j=0;
	int numbers[100];

	cin >> N >> A >> B >> C >> X;

	while(N || A || B || C || X) {

	for(i = 0; i < N; i++) {
		cin >> n;
		numbers[i] = n;
	}

	j = N;
	n = nn = X;

	for(i = 0; i <= 10000; i++) {
		if(n == numbers[N-j]) {
			j--;
		}
	
		if(j == 0) {
			goto success;
		}

		n = (A*nn+B)%C;

		nn = n;
	}
	
	cout << "-1" << endl;
	goto next;

success:
	cout << i << endl;
	goto next;
	
next:
	cin >> N >> A >> B >> C >> X;
	}
}

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