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

module SqIntMap = Map.Make (struct
  type t = int * int
  let compare = compare
end)

module IntMap = Map.Make (struct
  type t = int
  let compare = compare
end)

let () =
  let h, w, n = Scanf.scanf "%d %d %d\n" (fun h w n -> h, w, n) in
  let abs = Array.init n (fun _ -> Scanf.scanf "%d %d\n" (fun a b -> a, b)) in
  let dxdys = List.concat @@ Array.to_list @@ Array.init 3 (fun i -> Array.to_list @@ Array.init 3 (fun j -> (i - 2, j - 2))) in
  Array.fold_left (fun m (a, b) ->
    List.fold_left (fun m (dx, dy) ->
      if 1 <= a + dy && a + dy <= h - 2 && 1 <= b + dx && b + dx <= w - 2 then
        SqIntMap.add (a + dy, b + dx) (1 + try SqIntMap.find (a + dy, b + dx) m with Not_found -> 0) m
      else m) m dxdys) SqIntMap.empty abs
  |> (fun m -> SqIntMap.fold (fun _ i m -> IntMap.add i (1 + try IntMap.find i m with Not_found -> 0) m) m IntMap.empty)
  |> (fun m ->
      Array.init 10 (function
        | 0 -> (h - 2) * (w - 2) - IntMap.fold (fun _ -> ( + )) m 0
        | n -> try IntMap.find n m with Not_found -> 0))
  |> Array.iter (Printf.printf "%d\n")

Compiler output:
a.cc:14:27: error: stray '@' in program
   14 |   let dxdys = List.concat @@ Array.to_list @@ Array.init 3 (fun i -> Array.to_list @@ Array.init 3 (fun j -> (i - 2, j - 2))) in
      |                           ^
a.cc:14:28: error: stray '@' in program
   14 |   let dxdys = List.concat @@ Array.to_list @@ Array.init 3 (fun i -> Array.to_list @@ Array.init 3 (fun j -> (i - 2, j - 2))) in
      |                            ^
a.cc:14:44: error: stray '@' in program
   14 |   let dxdys = List.concat @@ Array.to_list @@ Array.init 3 (fun i -> Array.to_list @@ Array.init 3 (fun j -> (i - 2, j - 2))) in
      |                                            ^
a.cc:14:45: error: stray '@' in program
   14 |   let dxdys = List.concat @@ Array.to_list @@ Array.init 3 (fun i -> Array.to_list @@ Array.init 3 (fun j -> (i - 2, j - 2))) in
      |                                             ^
a.cc:14:84: error: stray '@' in program
   14 |   let dxdys = List.concat @@ Array.to_list @@ Array.init 3 (fun i -> Array.to_list @@ Array.init 3 (fun j -> (i - 2, j - 2))) in
      |                                                                                    ^
a.cc:14:85: error: stray '@' in program
   14 |   let dxdys = List.concat @@ Array.to_list @@ Array.init 3 (fun i -> Array.to_list @@ Array.init 3 (fun j -> (i - 2, j - 2))) in
      |                                                                                     ^
a.cc:1:1: error: 'module' does not name a type
    1 | module SqIntMap = Map.Make (struct
      | ^~~~~~
a.cc:1:1: note: C++20 'module' only available with '-fmodules-ts'
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
typedef pair<ll, ll> P;
int main()
{
  ll H, W, N; cin >> H >> W >> N;
  map<P, int> MAP;
  int vy[4] = {-1, -1, 0, 1, 1, 1, 0, -1};
  int vx[4] = {0, 1, 1, 1, 0, -1, -1, -1};
  FOR(i,0,N) {
    ll y, ll x; cin >> y >> x;
    FOR(j,0,8) {
      ll ny = y + vy[j];
      ll nx = x + vx[j];
      if(ny <= 0 || ny >= H - 1 || nx <= 0 || nx >= W - 1) continue;
      MAP[P(ny, nx)]++;
  }
  ll ans[9] = {0};
  for(auto &itr = MAP.begin(); itr != MAP.end(); itr++) {
    ans[itr->second]++;
  }
  ans[0] = (H - 2) * (W - 2);
  FOR(i,1,9) ans[0] -= ans[i];
  FOR(i,0,9) cout << ans[i] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:41: error: too many initializers for 'int [4]'
   25 |   int vy[4] = {-1, -1, 0, 1, 1, 1, 0, -1};
      |                                         ^
a.cc:26:41: error: too many initializers for 'int [4]'
   26 |   int vx[4] = {0, 1, 1, 1, 0, -1, -1, -1};
      |                                         ^
a.cc:28:14: error: expected initializer before 'x'
   28 |     ll y, ll x; cin >> y >> x;
      |              ^
a.cc:28:29: error: 'x' was not declared in this scope
   28 |     ll y, ll x; cin >> y >> x;
      |                             ^
a.cc:36:28: error: cannot bind non-const lvalue reference of type 'std::_Rb_tree_iterator<std::pair<const std::pair<long long int, long long int>, int> >&' to an rvalue of type 'std::map<std::pair<long long int, long long int>, int>::iterator' {aka 'std::_Rb_tree<std::pair<long long int, long long int>, std::pair<const std::pair<long long int, long long int>, int>, std::_Select1st<std::pair<const std::pair<long long int, long long int>, int> >, std::less<std::pair<long long int, long long int> >, std::allocator<std::pair<const std::pair<long long int, long long int>, int> > >::iterator'}
   36 |   for(auto &itr = MAP.begin(); itr != MAP.end(); itr++) {
      |                   ~~~~~~~~~^~
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:22:1: note: to match this '{'
   22 | {
      | ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#define MOD 1000000007
#define ll long long;
using namespace std;

int main()
{
	ll int h, w, n, flag,len;
	int a[100005];
	int b[100005];
	ll int c[1000006] = {};
	cin >> h >> w >> n;
	int i,j,k;
	long long int ans[10] = {};
	len = -1;
	for (i = 0; i < n; i++){
		cin >> a[i] >> b[i];
	}

	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			for (k = 0; k < 3; k++){
				if (a[i] - 1 + j >= 2 && a[i] - 1 + j <= h-1 && b[i] - 1 + k >= 2 && b[i] - 1 + k <= w-1){
					len = len + 1;
					c[len] = (a[i] - 1 + j) * w + (b[i] - 1 + k);
				}
			}
		}
	}

	if (len != -1){
		sort(begin(c), begin(c) + len);
	}
	flag = 1;
	for (i = 0; i < len+1; i++){
		if (c[i] == c[i + 1]){
			flag = flag + 1;
		}
		else{
			ans[flag] += 1;
			flag = 1;
		}
	}
	
	ans[0] = (h - 2)*(w - 2) - ans[1] - ans[2] - ans[3] - ans[4] - ans[5] - ans[6] - ans[7] - ans[8] - ans[9];
	if (ans[0] <= 0){
		ans[0] = 0;
	}
	for (i = 0; i < 10; i++){
		cout << ans[i] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: declaration does not declare anything [-fpermissive]
    6 | #define ll long long;
      |                 ^~~~
a.cc:11:9: note: in expansion of macro 'll'
   11 |         ll int h, w, n, flag,len;
      |         ^~
a.cc:6:17: error: declaration does not declare anything [-fpermissive]
    6 | #define ll long long;
      |                 ^~~~
a.cc:14:9: note: in expansion of macro 'll'
   14 |         ll int c[1000006] = {};
      |         ^~
Language: Java

import java.util.Scanner;
import java.awt.Point;
public class Main{

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

   public void solve(){
      Scanner scanner = new Scanner(System.in);
      long H = scanner.nextLong();
      long W = scanner.nextLong();
      int N = scanner.nextInt();

      Point[] point = new Point[N];
      for(int i=0; i<N; i++){
         int row = scanner.nextInt();
         int col = scanner.nextInt();
         point[i] = new Point(col, row);
      }

      HashMap<Point,Integer> hashmap = new HashMap<Point,Integer>();

      for(int i=0; i<N; i++){
         for(int y=-1; y<2; y++){
            for(int x=-1; x<2; x++){
               Point p = new Point(point[i].x+x, point[i].y+y);
               if(hashmap.get(p) == null){
                  hashmap.put(p,1);
               }else{
                  hashmap.put(p,hashmap.get(p)+1);
               }
            }
         }
      }

      long[] counter = new long[10];
      for(int i=0; i<counter.length; i++){
         counter[i] = 0;
      }
      for(HashMap.Entry<Point,Integer> map : hashmap.entrySet()){
         if(1<map.getKey().x && map.getKey().x<W && 1<map.getKey().y && map.getKey().y<H){
            counter[map.getValue()]++;
         }
      }
      for(int i=0; i<counter.length; i++){
         System.out.println(counter[i]);
      }

   }

}

Compiler output:
Main.java:22: error: cannot find symbol
      HashMap<Point,Integer> hashmap = new HashMap<Point,Integer>();
      ^
  symbol:   class HashMap
  location: class Main
Main.java:22: error: cannot find symbol
      HashMap<Point,Integer> hashmap = new HashMap<Point,Integer>();
                                           ^
  symbol:   class HashMap
  location: class Main
Main.java:41: error: package HashMap does not exist
      for(HashMap.Entry<Point,Integer> map : hashmap.entrySet()){
                 ^
3 errors
Language: C++

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;

//vector<pair<int, int> > mass;
vector<ll> mass;

ll H, W, zero = 0, ans[10];
int N, A, B;

int main() {
	cin >> H >> W >> N;
	for (int i = 0; i < N; i++) {
		cin >> A >> B;
		for (int j = A - 1; j <= A + 1; j++) {
			for (int k = B - 1; k <= B + 1; k++) {
//				pair<int, int> p(j, k);
//				mass.push_back(p);
				mass.push_back(j*H+k);
			}
		}
	}
	sort(mass.begin(), mass.end());
	for (int i = 0; i < mass.size(); i++) {
//		if (mass[i].first > 1 && mass[i].first < H && mass[i].second > 1 && mass[i].second < W) {
		if (mass[i]/H > 1 && mass[i]/H < H && mass[i]%H > 1 && mass[i]%H < W) {
			int j = 0;
//			pair<int, int> p(mass[i]);
			ll p = mass[i];
			
			zero++;
			while (true) {
				if (p == mass[i]) {
					j++;
					i++;
				} else {
					ans[j]++;
					i--;
					break;
				}
			}
		}
	}
	ans[0] = (H - 2) * (W - 2) - zero;
	for (int i = 0; i < 10; i++) {
		cout << ans[i] << endl;
	}
}

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

use std::collections::BTreeSet;

fn main() {
    let (h, w, n) = {
        let a = getvec::<i64>();
        (a[0], a[1], a[2])
    };
    let mut black = BTreeSet::new();
    let mut cand = BTreeSet::new();
    for _ in 0..n {
        let (y, x) = {
            let a = getvec::<i64>();
            (a[0], a[1])
        };
        black.insert((y, x));
        for i in (y - 2)..(y + 1) {
            for j in (x - 2)..(x + 1) {
                if i > 0 && j > 0 && i < h - 1 && j < w - 1 {
                    cand.insert((i, j));
                }
            }
        }
    }
    let mut ans = [0i64; 10];
    for &p in &cand {
        let (i, j) = p;
        let mut sum : usize = 0;
        for x in j..j + 3 {
            for y in i..i + 3 {
                if black.contains(&(y, x)) {
                    sum = sum + 1;
                }
            }
        }
        ans[sum] += 1;
    }
    ans[0] = (h - 2) * (w - 2);
    for i in 1..10 {
        ans[0] -= ans[i];
    }
    for i in 0..10 {
        println!("{}", ans[i]);
    }
}

fn next_line() -> String {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input).unwrap();
    input
}

#[allow(dead_code)]
fn getnum<T : std::str::FromStr>() -> T {
    let res = next_line();
    let res = res.trim().parse::<T>().ok().unwrap();
    res
}

#[allow(dead_code)]
fn getvec<T : std::str::FromStr>() -> Vec<T> {
    let res = next_line();
    let res : Vec<T> = res.split_whitespace().map(|x| x.parse::<T>().ok().unwrap()).collect();
    return res;
}

Compiler output:
a.cc:10:14: error: too many decimal points in number
   10 |     for _ in 0..n {
      |              ^~~~
a.cc:38:14: error: too many decimal points in number
   38 |     for i in 1..10 {
      |              ^~~~~
a.cc:41:14: error: too many decimal points in number
   41 |     for i in 0..10 {
      |              ^~~~~
a.cc:52:2: error: invalid preprocessing directive #[
   52 | #[allow(dead_code)]
      |  ^
a.cc:59:2: error: invalid preprocessing directive #[
   59 | #[allow(dead_code)]
      |  ^
a.cc:1:1: error: 'use' does not name a type
    1 | use std::collections::BTreeSet;
      | ^~~
a.cc:3:1: error: 'fn' does not name a type
    3 | fn main() {
      | ^~
a.cc:46:1: error: 'fn' does not name a type
   46 | fn next_line() -> String {
      | ^~
a.cc:53:1: error: 'fn' does not name a type
   53 | fn getnum<T : std::str::FromStr>() -> T {
      | ^~
a.cc:60:1: error: 'fn' does not name a type
   60 | fn getvec<T : std::str::FromStr>() -> Vec<T> {
      | ^~
Language: C++

#include <iostream>
using namespace std;
int main(){
int H,W,N;
cin>>H,W,N;
int arr[H][W]={};
int a,b;
for(int i=0;i<N;i++){
    cin>>a,b;
    arr[a][b]=1;
}
int hist[10]={};
    for(int i=0;i<H-2;i++){
        for(int j=0;j<W-2;j++){
            int temp=arr[i][j]+arr[i+1][j]+arr[i+2][j]+arr[i][j+1]+arr[i+1][j+1]+arr[i+2][j+1]+arr[i][j+2]+arr[i+1][j+2]+arr[i+2][j+2];
            hist[temp]++;
        }
    }
for(int k=0;k<10;k++)
{
    cout<<count<<endl;
}

return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 'count' was not declared in this scope
   21 |     cout<<count<<endl;
      |           ^~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
int H,W,N;
cin>>H,W,N;
int arr[H][W]={};
int a,b;
for(int i=0;i<N;i++){
    cin>>a,b;
    arr[a][b]=1;
}
int hist[10]={};
    for(int i=0;i<H-2;i++){
        for(int j=0;j<W-2;j++){
            int temp=arr[i][j]+arr[i+1][j]+arr[i+2][j]+arr[i][j+1]+arr[i+1][j+1]+arr[i+2][j+1]+arr[i][j+2]+arr[i+1][j+2]+arr[i+2][j+2];
            hist[temp]++
        }
    }
for(int k=0;k<10;k++)
{
    cout<<count<<endl;
}

return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected ';' before '}' token
   16 |             hist[temp]++
      |                         ^
      |                         ;
   17 |         }
      |         ~                
a.cc:21:11: error: 'count' was not declared in this scope
   21 |     cout<<count<<endl;
      |           ^~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
int H,W,N;
cin>>H,W,N;
int arr[H][W]={};
int a,b;
for(int i=0;i<N;i++){}
    cin>>a,b;
    arr[a][b]=1;
}

for(int k=0;k<10;k++)
{
    int count=0;
    for(int i=0;i<H-2;i++){
        for(int j=0;j<W-2;j++){
            int temp=arr[i][j]+arr[i+1][j]+arr[i+2][j]+arr[i][j+1]+arr[i+1][j+1]+arr[i+2][j+1]+arr[i][j+2]+arr[i+1][j+2]+arr[i+2][j+2];
            if(temp==k){
                count++;
            }
        }
    }
    cout<<count<<endl;
}




cout<<help(s,0)<<endl;

return 0;
}



Compiler output:
a.cc:13:1: error: expected unqualified-id before 'for'
   13 | for(int k=0;k<10;k++)
      | ^~~
a.cc:13:13: error: 'k' does not name a type
   13 | for(int k=0;k<10;k++)
      |             ^
a.cc:13:18: error: 'k' does not name a type
   13 | for(int k=0;k<10;k++)
      |                  ^
a.cc:30:1: error: 'cout' does not name a type
   30 | cout<<help(s,0)<<endl;
      | ^~~~
a.cc:32:1: error: expected unqualified-id before 'return'
   32 | return 0;
      | ^~~~~~
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

10 10 20
1 1
1 4
1 9
2 5
3 10
4 2
4 7
5 9
6 4
6 6
6 7
7 1
7 3
7 7
8 1
8 5
8 10
9 2
10 4
10 9

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 10 10 20
      | ^~
Language: C++

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

typedef unsigned long long ull;
ull res[10] = {};
vector<ull> c;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

    ull H, W, N;
    cin >> H >> W >> N;
    ull tot = (H-2)*(W-2);
    if(N==0){
        cout << tot << endl;
        for(int i=1; i<10; i++) cout << 0 << endl;
        return 0;
    }

    int a, b;
    for(int i=0; i<N; i++){
        cin >> a >> b;
        a--; b--;
        for(int j=0; j<3; j++){
            if(a-j < 0 || a-j >= H-2) continue;
            for(int k=0; k<3; k++){
                if(b-k < 0 || b-k >= W-2) continue;
                c.push_back( (a-j)*W + (b-k) );
            }
        }
    }
    sort(c.begin(), c.end());

    int dif = 1;
    int num = 0;
    ull prev = c[0];
    for(int i=0; i<c.size(); i++){
        if(c[i]==prev){
            num++;
            if(i==c.size()-1) res[num]++;
        }else{
            prev=c[i];
            res[num]++;
            num = 1;
            dif++;
        }
    }
    cout << tot - dif << endl;
    for(int i=1; i<10; i++){
        cout << res[i] << endl;
    }

	return 0;
}


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

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <vector>
#define INT long long int
#define MOD 1000000007
using namespace std;

INT h, w, n, all, sum, ans[10];
map<pair<int, int>, int> check;
int main()
{
    cin>>h>>w>>n;
    while( n-- )
    {
        int x, y;
        scanf("%d%d", &x, &y);f
        for(int i = -2 ; i <= 0 ; i++ )
            for(int j = -2 ; j <= 0 ; j++)
                if( 1 <= x+i&&x+i <= h-2 &&
                    1 <= y+j&&y+j <= w-2 )
                        check[make_pair(x+i,y+j)]++;
    }
    for(map<pair<int,int>,int>::iterator i = check.begin() ; i != check.end() ; i++ )
        ans[i->second]++;
    ans[0] = (w-2)*(h-2);
    for(int i = 1 ; i <= 9 ; i++ ) ans[0] -= ans[i];
    for(int i = 0 ; i <= 9 ; i++ )
        printf("%lld\n", ans[i]);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:31: error: 'f' was not declared in this scope
   19 |         scanf("%d%d", &x, &y);f
      |                               ^
a.cc:20:26: error: 'i' was not declared in this scope
   20 |         for(int i = -2 ; i <= 0 ; i++ )
      |                          ^
a.cc:21:30: error: 'j' was not declared in this scope
   21 |             for(int j = -2 ; j <= 0 ; j++)
      |                              ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef map<int, int> Mii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

Mii m[100100100];
ll sum[11];

int main()
{
	ll H, W, N;
	cin >> H >> W >> N;
	int h, w;
	sum[0] = (H-2)*(W-2);
	rep(i,0,N) {
		cin >> h >> w; 
		h--; w--;
		rep(i,0,3) rep(j,0,3) {
			if (h-i >= 0 && h-i < H-2 && w-j >= 0 && w-j < W-2 ) {
				sum[m[h-i][w-j]]--;
				m[h-i][w-j]++;
				sum[m[h-i][w-j]]++;
			}
		}
	}
	rep(i,0,10) {
		cout << sum[i] << endl;
	}

	return 0;
}

Compiler output:
/tmp/ccaGq04O.o: in function `main':
a.cc:(.text+0x59): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/ccaGq04O.o
a.cc:(.text+0x153): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/ccaGq04O.o
a.cc:(.text+0x16c): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/ccaGq04O.o
a.cc:(.text+0x1fb): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/ccaGq04O.o
a.cc:(.text+0x214): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/ccaGq04O.o
a.cc:(.text+0x268): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/ccaGq04O.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#define LL long long
using namespace std;

LL h, w, n;
LL re[10];

set< pair<int ,int> > st;
void f(int a, int b) {
    int num[3][3];
    memset(num, -1, sizeof(num));

    for(int i = 0; i < 3; ++i)
    for(int j = 0; j < 3; ++j) {
        int x1 = a - 2 + i, y1 = b - 2 + j;
        int x2 = a + i, y2 = b + j;
        if(x1 < 0 || y1 < 0 || x2 >= h || y2 >= w) continue;
        num[i][j] = 0;
    }
    for(int i = max(a-2, 0); i <= min((LL)a+2, h-1); ++i) {
        for(int j = max(b-2, 0); j <= min((LL)b+2, w-1); ++j) {
            if(st.find( make_pair(i, j) ) != st.end() ) {
                for(int ii = 0; ii < 3; ++ii)
                for(int jj = 0; jj < 3; ++jj) {
                    int x1 = a-2+ii, y1 = b-2+jj;
                    int x2 = a + ii, y2 = b + jj;
                    if(x1 < 0 || y1 < 0 || x2 >= h || y2 >= w) continue;
                    if(i >= x1 && i <= x1+2 && j >= y1 && j <= y1+2) {
                        if(num[ii][jj] == -1) num[ii][jj] = 1;
                        else num[ii][jj] += 1;
                    }
                }
            }
        }
    }
    for(int i = 0; i < 3; ++i)
    for(int j = 0; j < 3; ++j) {
        //cout << a << " " << b << " " << i << " " << j << " " << num[i][j] << endl;
        if(num[i][j] == -1) continue;
        re[ num[i][j] ] --;
        re[ num[i][j] + 1] ++;
    }
}
int main(int argc, char* argv[]) {
    while(cin >> h >> w >> n) {
        st.clear();
        memset(re, 0, sizeof(re));
        re[0] = (h - 2) * (w - 2);
        for(LL i = 0; i < n; ++i) {
            int a, b;
            cin >> a >> b;
            --a, --b;
            f(a, b);
            st.insert( make_pair(a, b) );
        }
        for(int i = 0; i < 10; ++i) {
            cout << re[i] << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'void f(int, int)':
a.cc:15:5: error: 'memset' was not declared in this scope
   15 |     memset(num, -1, sizeof(num));
      |     ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <cstdio>
  +++ |+#include <cstring>
    6 | #define LL long long
a.cc: In function 'int main(int, char**)':
a.cc:51:9: error: 'memset' was not declared in this scope
   51 |         memset(re, 0, sizeof(re));
      |         ^~~~~~
a.cc:51:9: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n, m;
    cin >> n >> m;
    vector<vector<pair<int, int> > >edge(n + 3);
    vector<vector<int> >rails(n + 3);
    for(int i = 1; i <= m; i++){
        int u, v, c;
        cin >> u >> v >> c;
        edge[u].push_back({c, v});
        edge[v].push_back({c, u});
        rails[u].push_back(c);
        rails[v].push_back(c);
    }
    for(int i = 1; i <= n; i++){
        sort(edge[i].begin(), edge[i].end());
    }
    deque<pair<int, pair<int, int> > >dq;
    vector<map<int, int> >mp(n + 3);
    mp[1][0] = 0;
    dq.push_back({0, {1, 0}});
    while(!dq.empty()){
        int d = dq.front().first;
        int now = dq.front().second.first;
        int rail = dq.front().second.second;
        dq.pop_front();
        if(rail == 0){
            for(int i = 0; i < rails[now].size(); i++){
                int nrail = rails[now][i];
                if(mp[now].find(nrail) != mp[now].end() && mp[now][nrail] <= d + 1){
                    continue;
                }
                mp[now][nrail] = d + 1;
                dq.push_back({d + 1, {now, nrail}});
            }
        }
        else{
            pair<int, int>p = make_pair(rail, 0);
            int x = lower_bound(edge[now].begin(), edge[now].end(), p) - edge[now].begin();
            while(x != edge[now].size() && edge[now][x].first == rail){
                int nxt = edge[now][x].second;
                if(mp[nxt].find(rail) != mp[nxt].end() && mp[nxt][rail] <= d){
                    x++;
                    continue;
                }
                mp[nxt][rail] = d;
                dq.push_front({d, {nxt, rail}});
                x++;
            }
            if(mp[now].find(0) != mp[now].end() && mp[now][0] <= d){
                continue;
            }
            mp[now][0] = d;
            dq.push_front({d, {now, 0}});
        }
    }
    if(mp[n].empty()){
        cout << "-1";
        return 0;
    }
    int ans = 1e8;
    for(int i = 0; i < rails[n].size(); i++){
        int x = rails[n][i];
        ans = min(ans, mp[n][x]);
    }
    else{
        cout << ans;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:5: error: 'else' without a previous 'if'
   67 |     else{
      |     ^~~~
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
struct Edge{
	int t,nxt,w;
}e[N<<2];
int cnt,head[N];
inline void add(int u,int v,int w){
	e[++cnt].nxt=head[u];
	e[cnt].t=v;
	e[cnt].w=w;
	head[u]=cnt;
}
char buf[1<<23],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
inline int rd() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-') f=-1;ch=getchar();}
	while(isdigit(ch)) x=x*10+(ch^48),ch=getchar();
	return x*f;
}
set<int> st[N];
int vis[N],n,m,dis[N];
int dij(){
	memset(dis,0x3f,sizeof dis);
	priority_queue< pair<int,int > >q;
	q.push(make_pair(0,1));
	dis[1]=0;
	while (!q.empty()){
		int u=q.top().second;
		q.pop();
		if (vis[u]) continue;
		vis[u]=1;
		for (int i=head[u];i;i=e[i].nxt){
			int v=e[i].t,w=1;
			if (st[u].count(e[i].w)) w=0;
			if (dis[u]+w<dis[v]){
				dis[v]=dis[u]+w;
				st[v].clear();
				st[v].insert(e[i].w);
				q.push(make_pair(-dis[v],v));
			}else if (dis[u]+w==dis[v]) {
				if (!st[v].count(e[i].w)){
					st[v].insert(e[i].w);
					q.push(make_pair(-dis[v],v));
					vis[v]=0;		
				}
			}
		}
	}
	if (dis[n]>1e9) return -1;
	else return dis[n];
}
int main(){
	n=rd();m=rd();
	int u,v,w;
	for (int i=1;i<=m;++i){
		u=rd();
		v=rd();
		w=rd();
		add(u,v,w);
		add(v,u,w);
	}
	printf("%d\n",dij());
} 

Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_Rb_tree_impl<std::less<int>, true>::~_Rb_tree_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = std::_Rb_tree_node<int>]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/map:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152:
/usr/include/c++/14/bits/stl_tree.h:658:16: note: called from here
  658 |         struct _Rb_tree_impl
      |                ^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> piii;
const int INF=1000000000;
#define endl "\n"
#define pb(a) push_back(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define all(x) (x).begin(), (x).end()
#define out(x) cout << __LINE__ << ": " << (#x) << " = " << (x) << endl



int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);

  int N, M;
  cin >> N >> M;
  vector<int> dist(N+1,INF);
  dist[1]=0;
  vector<vector<pii>> adj(N+1);

  set <piii, greater<piii>> checker;


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

  priority_queue<piii,vector<piii>,greater<piii>> pq;


  piii temp=make_tuple(0,1,-1);
  piii temp2;
  int curr=0;
  pii t;
  

  pq.push(temp);

  while (!pq.empty()){
  //printy(checker);
    //rese(dist);
    temp=pq.top();
    pq.pop();

    for (int i=0; i<adj[get<1>(temp)].size(); i++){
      t=adj[get<1>(temp)][i];
      curr=get<0>(temp);
      if (t.second!=get<2>(temp)) curr++;

      temp2=make_tuple(get<1>(temp),t.first,t.second)

      if (dist[t.first]>curr or (dist[t.first]==curr and checker.find(temp2)==checker.end()) ){
        dist[t.first]=curr;
        checker.insert(temp2);
        
        // temp2.distance=curr;
        // temp2.node=t.first;
        // temp2.company=t.second;
        pq.push(make_tuple(curr,t.first,t.second));
      }

     


    }   

  }
  if (dist[N]==INF) dist[N]=-1;
  cout<<dist[N]<<endl;




} 


Compiler output:
a.cc: In function 'int main()':
a.cc:61:54: error: expected ';' before 'if'
   61 |       temp2=make_tuple(get<1>(temp),t.first,t.second)
      |                                                      ^
      |                                                      ;
   62 | 
   63 |       if (dist[t.first]>curr or (dist[t.first]==curr and checker.find(temp2)==checker.end()) ){
      |       ~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> piii;
const int INF=10000000;





int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);

  int N, M;
  cin >> N >> M;
  vector<int> dist(N+1,INF);
  dist[1]=0;
  vector<vector<pii>> adj(N+1);


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

  priority_queue<piii,vector<piii>,greater<piii>> pq;

  //dist,node,company
  piii temp=make_tuple(0,1,-1);
  pii t;
  
  pq.push(temp);

  while (!pq.empty()){
    temp=pq.top();
    pq.pop();
    curr=get<0>(temp); // distance

    for (int i=0; i<adj[get<1>(temp)].size(); i++){
      t=adj[get<1>(temp)][i];
 // distance
      if (t.second!=get<2>(temp)) curr++;

      if (dist[t.first]>=curr){
        dist[t.first]=curr;
        // temp2.distance=curr;
        // temp2.node=t.first;
        // temp2.company=t.second;
        pq.push(make_tuple(curr,t.first,t.second));
      }


    }   

  }
  if (dist[N]==INF) dist[N]=-1;
  cout<<dist[N]<<endl;




} 


Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: 'curr' was not declared in this scope
   41 |     curr=get<0>(temp); // distance
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> piii;
const int INF=10000000;




int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);

  int N, M;
  cin >> N >> M;
  vector<int> dist(N+1,INF);
  dist[1]=0;
  vector<vector<pii>> adj(N+1);


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

  priority_queue<piii,vector<piii>,greater<piii>> pq;


  piii temp=make_tuple(0,1,-1);
  pii t;
  
  pq.push(temp);

  while (!pq.empty()){
    //rese(dist);
    temp=pq.top();
    pq.pop();

    for (int i=0; i<adj[temp.node].size(); i++){
      t=adj[get<1>(temp)][i];
      curr=get<0>(temp);
      if (t.second!=get<2>(temp)) curr++;

      if (dist[t.first]>curr){
        dist[t.first]=curr;
        // temp2.distance=curr;
        // temp2.node=t.first;
        // temp2.company=t.second;
        pq.push(make_tuple(curr,t.first,t.second));
      }


    }   

  }
  cout<<dist[N]<<endl;




} 


Compiler output:
a.cc: In function 'int main()':
a.cc:42:30: error: 'piii' {aka 'class std::tuple<int, int, int>'} has no member named 'node'
   42 |     for (int i=0; i<adj[temp.node].size(); i++){
      |                              ^~~~
a.cc:44:7: error: 'curr' was not declared in this scope
   44 |       curr=get<0>(temp);
      |       ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN=1e5+6;
int n,m,ans=(int)1e9;
vector<pair<int,int> >g[MAXN];
map<pair<int,int>,int>mp;
int main()
{
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        int p,q,c;
        cin>>p>>q>>c;
        g[p].push_back({q,c});
        g[q].push_back({p,c});
    }
    mp[{1,-1}]=0;
    deque<pair<int,int> >dq;
    dq.push_back({1,-1});
    while(!dq.empty())
    {
        pair<int,int> u=dq.front();
        //cout<<u.first<<" "<<u.second<<endl;
        if(u.first==n)ans=min(ans,mp[u]);
        dq.pop_front();
        for(int i=0;i<g[u.first].size();i++)
        {
            pair<int,int> t=g[u.first][i];
            if(mp.count(t)&&mp[u]+(t.second!=u.second)>=mp[t])continue;
            mp[t]=mp[u]+(t.second!=u.second);
            if(t.second==u.second)
            {
                dq.push_front(t);
            }
            else dq.push_back(t);
        }
    }
    if(as==1000000000)
    {
        cout<<"-1\n";
        return 0;
    }
    cout<<ans<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:8: error: 'as' was not declared in this scope; did you mean 'ans'?
   38 |     if(as==1000000000)
      |        ^~
      |        ans
Language: C++

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

const int N = 1e5+5;
vector<pair<int,int>> g[N];

bool vis[N];
int ans = N;
int n,m;
void dfs(int x, int c,int prev){
  vis[x] = true;
  if(x == n-1){
      ans = min(ans,c);
      return ;
  }
  for(auto to : g[x]){
      if(vis[to.first]) continue;
      if(prev!=to.second) dfs(to.first,c+1,to.second);
      else dfs(to.first,c,to.second);
      vis[to.first] = false;
  }
}

int main(){
    cin>>n>>m;
    
    for(int i = 0; i < m; i++){
        int p,q,c;
        cin>>p>>q>>c;
        --p,--q;
        g[p].push_back({q,c});
        g[q].push_back({p,c});
    }

    dfs(0,0,0);
    if(ans == N) cout<<-1;
    else cout<<ans
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:19: error: expected ';' before '}' token
   37 |     else cout<<ans
      |                   ^
      |                   ;
   38 | }
      | ~
Language: C++

#include <bits\stdc++.h>
using namespace std;
typedef pair<int, int> pi;
int inf=1e9;
int n, m;
map<pi, int> mp;
pi po[500000];
int d[500000];
priority_queue<pi> pq;
bool operator < (pi a, pi b) {
	return a.first>b.first;
}
vector<int> g[500000];
vector<int> g1[500000];	
int cnt=0, ans=inf;
void dij()
{
	for (int i=0; i<2*n; i++) d[i]=inf;
	
	for (int i=0; i<g[1].size(); i++)
	{
		int u=g[1][i];
		d[u]=0;
		pq.push({d[u], u});
	}
	
	while(!pq.empty())
	{
		pi x= pq.top();
		pq.pop();
		if (d[x.second]!=x.first) continue;
		
		pi u=po[x.second];
		
		//cout << u.first << ' ' << u.second << ' ' << x.first << endl;
		for (int i=0; i<g1[u.first].size(); i++)
		{
			int v= g1[u.first][i];
			for (int j=0; j<g[v].size(); j++)
			{
				int v0= g[v][j];
				int e = !(u.second == po[v0].second);
				
				if (d[x.second]+ e < d[v0])
				{
					//cout << u.first << ' ' << u.second << ' ' << x.first << ' ' << po[v0].first << ' ' << po[v0].second ;
					d[v0]= d[x.second]+ e;
					pq.push({d[v0], v0}); //cout << ' ' << d[v0] << endl;
				
					if (po[v0].first== n) 
					{
						ans=min(ans, d[v0]);
						//cout << ans << endl;
						//cout << po[v0].first << ' ' << po[v0].second << endl;
					}
				}	
			}
		}
	}
}
int main()
{
	cin>>n>>m;

	for (int i=0; i<m; i++)
	{
		int x, y, z; cin>>x>>y>>z;
		if (!mp[pi{x, z}]) {
			mp[pi{x, z}]=++cnt;
			po[cnt]=pi{x, z};
			g[x].push_back(cnt);
		}
		if (!mp[pi{y, z}]) {
			mp[pi{y, z}]=++cnt;
			po[cnt]=pi{y, z};
			g[y].push_back(cnt);
		}
		g1[x].push_back(y);
		g1[y].push_back(x);
	}
	dij();
	//cout << (ans<inf)? ans+1:-1 ;
	if (ans<inf) cout << ans+1 << endl;
	else cout << -1;
} 

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

#include "debug.h"
#include <string.h>
#include <limits.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;

#define MAXN 100000

template<class T>
struct gufs {
	map<T,T> f;
	map<T,int> c;
	T find(T v) {
		T r, u;
		for(r=v; f.find(r) != f.end(); r=f[r]);
		for(u=v; u!=r; ) {
			T t = f[u];
			f[u] = r;
			u = t;
		}
		if (c.find(r)==c.end())
			c[r] = 1;
		return r;
	}
	T merge(T a, T b) {
		a = find(a);
		b = find(b);
		if (a!=b) {
			f[a] = b;
			c[b] += c[a];
		}
		return b;
	}
	void clear() {
		f.clear();
		c.clear();
	}
	int count(int v){
		return c[find(v)];
	}
	void get_sets(map<T,vector<T>> &s) {
		for (auto &x: f) {
			s[find(x.first)].push_back(x.first);
		}
		for (auto &x: s) {
			s[x.first].push_back(x.first);
		}
	}
};

int n, m;
vector<pair<int,int>> g[MAXN];

map<int, gufs<int>> u;
map<int, map<int, vector<int>>> us;

int q[MAXN];
int h, t;
int dist[MAXN];

void adde(int a, int b, int c) {
	g[a].push_back({b,c});
	g[b].push_back({a,c});

	u[c].merge(a, b);
}

int input() {
	if (scanf("%d %d", &n, &m) < 0) return 0;
	for (int i=0; i<m; i++) {
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		a--, b--, c--;
		adde(a,b,c);
	}
	return 1;
}

void init() {
	for (int i=0; i<n; i++) dist[i] = INT_MAX;
	for (auto &x: u)
		x.second.get_sets(us[x.first]);
}

void push_q(int v, int c, int d) {
	int r = u[c].find(v);
	for (auto &x: us[c][r]) {
		if (d < dist[x]) {
			dist[x] = d;
			q[t++] = x;
		}
	}
}

int solve() {
	h=0, t=0;
	dist[0] = 0;
	q[t++] = 0;
	while (h<t) {
		int v = q[h++], d = dist[v];
		//printf("-->v=%d d=%d\n", v, d);
		for(auto &x: g[v]) {
			int u = x.first, c = x.second;
			//need to process when dist[u]==d
			if (dist[u] < d) continue;
			push_q(u, c, d+1);
		}
	}
	//cout << us << endl; printa(dist,n);
	return dist[n-1];
}

void output(int ans) {
	printf("%d\n", ans==INT_MAX? -1: ans);
}

void cleanup() {
	for (int i=0; i<n; i++) g[i].clear();
	u.clear();
	us.clear();
}

int main() {
	//int ca; scanf("%d", &ca);
	while (input()) {
		init();
		output(solve());
		cleanup();
		//break;
	}
}





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

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

using namespace std;
const int N = 1e6;

int n, m;
int tot = 0, tag = 0, cnt = 0;
int vis[N], b[N], fa[N], num[N], Link[N], dis[N]; 
struct node { int x, y; }; 
struct edge { int y, next, v; } e[N*2];
vector < node > a[N];

int read(void)
{
	int s = 0, w = 0; char c = getchar();
	while (c < '0' || c > '9') w |= c == '-', c = getchar();
	while (c >= '0' && c <= '9') s = s*10+c-48, c = getchar();
	return w ? -s : s;
}

int get(int x) {
	if (fa[x] == x) return x;
	return fa[x] = get(fa[x]);
}

void add(int x,int y,int v) {
	e[++tot] = edge{y,Link[x],v};
	Link[x] = tot;
}

void work(int x)
{
	int t = 0;
	tag ++;
	for (int i=0;i<a[x].size();++i)
	{
		int p1 = a[x][i].x, p2 = a[x][i].y;
		if (vis[p1] != tag) b[++t] = p1, vis[p1] = tag;
		if (vis[p2] != tag) b[++t] = p2, vis[p2] = tag;
	}
	for (int i=1;i<=t;++i) fa[b[i]] = b[i];
	for (int i=0;i<a[x].size();++i) 
	{
		int p1 = a[x][i].x, p2 = a[x][i].y;
		fa[get(p1)] = get(p2);
	}
	tag ++;
	for (int i=1;i<=t;++i)
	{
		int r = get(b[i]);
		if (vis[r] != tag) 
		{
			vis[r] = tag;
			num[r] = ++ cnt;
		}
		add(b[i],num[r],1);
		add(num[r],b[i],1);
	}
	return;
}

int Dijkstra(void)
{
	memset(vis,0,sizeof vis);
	memset(dis,30,sizeof dis);
	dis[1] = 0;
	priority_queue < pair<int,int> > q;
	q.push(make_pair(0,1));
	while (q.size())
	{
		int x = q.top().second; q.pop();
		if (vis[x]) continue; vis[x] = 1;
		if (x == n) return dis[x] / 2; 
		for (int i=Link[x];i;i=e[i].next)
		{
			int y = e[i].y, v = e[i].v;
			if (dis[x] + v < dis[y]) {
				dis[y] = dis[x] + v;
				q.push(make_pair(-dis[y],y));
			}
		}
	}
	return -1;
}

int main(void)
{
	n = cnt = read(), m = read();
	for (int i=1;i<=m;++i)
	{
		int x = read(), y = read(), v = read();
		a[v].push_back(node{x,y});
	}
	for (int i=1;i<=1e6;++i)
	    if (a[i].size()) work(i);
	printf("%d", Dijkstra());
	return 0;
} 

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

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
struct edge{ int to, num; };
const int INF = 1001001001;
const int MAX_V = 200005;
int V,E;
vector<edge> G[MAX_V];
int d[MAX_V];
set<int> se[MAX_V];
int f[MAX_V];
 
void dijkstra(int s){
    // greater<P>を指定することでfirstが小さい順に取り出せるようにする
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+V, INF);
    d[s] = 0;
    que.push(P(0, s));
 
    while(!que.empty()){
        P p = que.top();
        que.pop();
        int v = p.second;
        if(d[v] >= d[V-1])continue;
        if(f[v] == 1)continue;
        f[v] = 1;
        for(int i=0; i<G[v].size(); i++){
            edge e = G[v][i];
            if(d[e.to] >= d[v]){
                auto it = se[v].find(e.num);
                if(it != se[v].end()){
                    if(d[e.to] == d[v]){
                        auto it2 = se[e.to].find(e.num);
                        if(it2 == se[e.to].end()){
                            se[e.to].insert(e.num);
                            f[e.to] = 0;
                            que.push(P(d[e.to], e.to));
                        }
                    }else{
                        se[e.to].clear();
                        se[e.to].insert(e.num);
                        d[e.to] = d[v];
                        f[e.to] = 0;
                        que.push(P(d[e.to], e.to));
                    }
                }else if(d[e.to] > d[v]){
                    if(d[e.to] == d[v] + 1){
                        auto it2 = se[e.to].find(e.num);
                        if(it2 == se[e.to].end()){
                            se[e.to].insert(e.num);
                            f[e.to] = 0;
                            que.push(P(d[e.to], e.to));
                        }
                    }else{
                        se[e.to].clear();
                        se[e.to].insert(e.num);
                        d[e.to] = d[v] + 1;
                        f[e.to] = 0;
                        que.push(P(d[e.to], e.to));
                    }
                }
            }
        }
    }
}
 
int main() {
    cin >> V >> E;
    rep(i,E){
        int from,to,num;
        cin >> from >> to >> num;
        from--; to--;
        edge e1, e2;
        e1.to = to; e1.num = num;
        e2.to = from; e2.num = num;
        G[from].push_back(e1);
        G[to].push_back(e2);
    }
 
    dijkstra(0);
 
    if(d[V-1] == INF)d[V-1] = -1;
    cout << d[V-1] << endl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define all(a) (a).begin(),(a).end()
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=10000000000000000;


int main(){
    int m,n;
    cin >> n >> m;
    vector<vector<pp>> e(n+1,vector<pp>(0));
    vector<
    vector<int> d(n+1,inf);
    d.at(1)=0;
    rep(i,m){
        int p,q,c;
        cin >> p >> q >> c;
        e.at(p).push_back(make_pair(q,c));
        e.at(q).push_back(make_pair(p,c));
    }
    queue<pp> q;
    queue<pair<pp,pp>> qq;
    q.push(make_pair(1,0));
    while (!q.empty()){
        int u=q.front().first,c=q.front().second;
        q.pop();
        rep(i,e.at(u).size()){
            if (d.at(e.at(u).at(i).first)>c+1) {
                qq.push(make_pair(make_pair(e.at(u).at(i).first,u),make_pair(e.at(u).at(i).second,c+1)));
                q.push(make_pair(e.at(u).at(i).first,c+1));d.at(e.at(u).at(i).first)=c+1;}
            
        }
        while (!qq.empty()){
            int f=qq.front().first.first,g=qq.front().first.second,h=qq.front().second.first,k=qq.front().second.second;
            qq.pop();
            rep(i,e.at(f).size()){
                if (e.at(f).at(i).second==h && e.at(f).at(i).first!=g){
                    if (d.at(e.at(f).at(i).first)>k) {q.push(make_pair(e.at(f).at(i).first,k));d.at(e.at(f).at(i).first)=k;}
                    qq.push(make_pair(make_pair(e.at(f).at(i).first,f),make_pair(e.at(f).at(i).second,k)));
                }
            }
        }
        
    }
    if (d.at(n)==inf) cout << -1 << endl;
    else cout << d.at(n) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: template argument 1 is invalid
   18 |     vector<int> d(n+1,inf);
      |                          ^
a.cc:18:26: error: template argument 2 is invalid
a.cc:19:5: error: 'd' was not declared in this scope
   19 |     d.at(1)=0;
      |     ^
Language: C++

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

#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif

const int N = 200001 * 2 + N;
struct edge{ int to,cost; };
vector< edge > G[N];

void dikstra(int s,int t){
  typedef pair<int, int> P;
  const int INF = 1 << 30;

  priority_queue<P,vector<P>,greater<P>> que;
  vector<int> d(N,INF); //sからの最短距離
  d[s] = 0;
  que.push({0,s}); //{最短距離,頂点}

  while( !que.empty() ){
    P p = que.top(); que.pop();
    int v = p.second;
    if(d[v] < p.first) continue;
    for(auto e : G[v]){
      if(d[e.to] > d[v] + e.cost){
        d[e.to] = d[v] + e.cost;
        que.push( {d[e.to],e.to} );
      }
    }
  }
  if(d[t] == INF) cout << -1 << endl;
  else cout << d[t] << endl;
}

using P = pair<int,int>;

signed main(){

  int n,m; cin >> n >> m;
  vector<int> p(m),q(m),c(m);
  vector<vector<int>> station(n);
  vector<P> v;
  for(int i = 0; i < m; i++){
    cin >> p[i] >> q[i] >> c[i];
    p[i]--,q[i]--,c[i]--;
    station[p[i]].push_back(c[i]);
    station[q[i]].push_back(c[i]);
    v.push_back({p[i],c[i]});
    v.push_back({q[i],c[i]});
  }

  for(int i = 0; i < n; i++){
    v.push_back({i,-1});
  }
  // sort(v.begin(),v.end());
  // v.erase(unique(v.begin(),v.end()),v.end());

  map<pair<int,int>,int> mp;
  for(int i = 0; i < v.size(); i++){
    mp[v[i]] = i;
  }

  for(int i = 0; i < n; i++){
    for(int c : station[i]){
      int u = mp[{i,c}];
      int v = mp[{i,-1}];
      G[v].push_back({u,0});
      G[u].push_back({v,1});
    }
  }

  for(int i = 0; i < m; i++){
    int u = mp[{p[i],c[i]}];
    int v = mp[{q[i],c[i]}];
    G[u].push_back({v,0});
    G[v].push_back({u,0});
  }
  dikstra(mp[{0,-1}],mp[{n-1,-1}]);

  return 0;
}


Compiler output:
a.cc:11:18: error: size of array 'G' is not an integral constant-expression
   11 | vector< edge > G[N];
      |                  ^