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

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

void WarshallFloyd(int** map){
    for (int a = 0; a < 10; a++)
    {
        for (int b = 0; b < 10; b++)
        {
            for (int c = 0; c < 10; c++)
            {
                map[b][c] = min(map[b][a] + map[a][c], map[b][c]);
            }
        }
    }
}
main(){

    int h,w;
    cin >> h>>w;
    	int map[10][10]={0};
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            cin >>map[i][j];
        }
    }
/*
    for(int a=0;a<10;a++){
        for(int b=0;b<10;b++){
            for(int c=0;c<10;c++){
                map[b][c]=min(map[b][a]+map[a][c],map[b][c]);
            }
        }
    }
    */
    WarshallFloyd(map);
     long long ans = 0;
    int value;
    for(int i=0;i<w;i++){
        for(int j=0;j<h;j++){
            cin >>value;
            if(value>=0){
                ans+=map[value][1];
            }
        }
    }
    cout << ans;
    
    
}


Compiler output:
a.cc:16:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   16 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:35:19: error: cannot convert 'int (*)[10]' to 'int**'
   35 |     WarshallFloyd(map);
      |                   ^~~
      |                   |
      |                   int (*)[10]
a.cc:4:26: note:   initializing argument 1 of 'void WarshallFloyd(int**)'
    4 | void WarshallFloyd(int** map){
      |                    ~~~~~~^~~
Language: C++

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

void WarshallFloyd(int** map){
    for (int a = 0; a < 10; a++)
    {
        for (int b = 0; b < 10; b++)
        {
            for (int c = 0; c < 10; c++)
            {
                map[b][c] = min(map[b][a] + map[a][c], map[b][c]);
            }
        }
    }
}
main(){

    int h,w;
    cin >> h>>w;
    long long map[10][10]={0};
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            cin >>map[i][j];
        }
    }
/*
    for(int a=0;a<10;a++){
        for(int b=0;b<10;b++){
            for(int c=0;c<10;c++){
                map[b][c]=min(map[b][a]+map[a][c],map[b][c]);
            }
        }
    }
    */
    WarshallFloyd(map);
     long long ans = 0;
    int value;
    for(int i=0;i<w;i++){
        for(int j=0;j<h;j++){
            cin >>value;
            if(value>=0){
                ans+=map[value][1];
            }
        }
    }
    cout << ans;
    
    
}


Compiler output:
a.cc:16:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   16 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:35:19: error: cannot convert 'long long int (*)[10]' to 'int**'
   35 |     WarshallFloyd(map);
      |                   ^~~
      |                   |
      |                   long long int (*)[10]
a.cc:4:26: note:   initializing argument 1 of 'void WarshallFloyd(int**)'
    4 | void WarshallFloyd(int** map){
      |                    ~~~~~~^~~
Language: C++

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

int main()
{
  
  int h,w;
  cin>>h>>W;
  int arr[h][w];
  int cost[10][10];
  
  for(int i=0;i<10;i++)
    for(int j=0;j<10;j++)
      cin>>cost[i][j];
  
  
  
  for(int k=0;k<10;k++){
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
        
        if(cost[i][j]>cost[i][k]+cost[k][j])
          cost[i][j]=cost[i][k]+cost[k][j];
      }
    }
  }
  
  long long sum=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int a;
      cin>>a;
      sum=sum+arr[a][1];
    }
  }
  
  cout<<sum<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'W' was not declared in this scope
    8 |   cin>>h>>W;
      |           ^
Language: C++

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

int H, W;
vector<vector<int>> c(10, vector<int>(10));
vector<vector<int>> a(200, vector<int>(200));




int main() {
	cin >> H >> W;
	for(int i=0; i<10; i++){
		for(int j=0; j<10; j++){
			cin >> c.at(i).at(j);
		}
	}
	for(int i=0; i<H; i++){
		for(int j=0; j<W; j++){
			cin >> a.at(i).at(j);
		}
	}
	for(int i=0; i<10; i++){
		b.at(i) = 10000;
	}
	for(int x=0; x<10; x++){
		for(int i=0; i<10; i++){
			for(int j=0; j<10; j++){
				c.at(i).at(j) = min(c.at(i).at(j), c.at(i).at(x)+c.at(x).at(j));
			}
		}
	}
	long long sum=0;
	for(int i=0; i<H; i++){
		for(int j=0; j<W; j++){
			if(a.at(i).at(j) == -1){
				continue;
			}else{
				sum += c.at(a.at(i).at(j)).at(1);
			}
		}
	}
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'b' was not declared in this scope
   24 |                 b.at(i) = 10000;
      |                 ^
Language: C++

#include <bits/stdc++.h> 
#include <iostream>

using namespace std;


 int c[10][10]; 
int s,t,a[210][210],res; 
int main() { 
  scanf("%d%d",&s,&t); 
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
        scanf("%d",&c[i][j]);
      }
    }
  
  for(int i=0;i<s;i++){
    for(int j=0;j<t;j++){
      scanf("%d",&a[i][j]); 
    }
  }
  
 for(int i=0;i<10;i++){
   for(int j=0;j<10;j++){
     for(int k=0;k<10;k++){

    if(c[i][j]>c[i][k]+c[k][j])c[i][j]=c[i][k]+c[k][j];
     }
   }
 }
  for(int i=0;i<s;i++){
    for(int j=0;j<t;j++){
    
    
    if(a[i][j] != -1){
      res+=c[a[i][j]][1]; 
    }
      
  }
    
  printf("%d\n",res);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

#include <cstdio > 
 int c[10][10]; 
int s,t,a[210][210],res; 
int main() { 
  scanf("%d%d",&s,&t); 
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
        scanf("%d",&c[i][j]);
      }
    }
  
  for(int i=0;i<s;i++){
    for(int j=0;j<t;j++){
      scanf("%d",&a[i][j]); 
    }
  }
  
 for(int i=0;i<10;i++){
   for(int j=0;j<10;j++){
     for(int k=0;k<10;k++){

    if(c[i][j]>c[i][k]+c[k][j])c[i][j]=c[i][k]+c[k][j];
     }
   }
 }
  for(int i=0;i<s;i++){
    for(int j=0;j<t;j++){
    
    
    if(a[i][j] != -1){
      res+=c[a[i][j]][1]; 
    }
      
  }
    
  printf("%d\n",res);
}


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

import java.util.*;
import java.io.*;

public class Main {
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

	public static void main(String[] args) throws IOException {
		String[] hw = br.readLine().split(" ");
		int h = Integer.parseInt(hw[0]);
		int w = Integer.parseInt(hw[1]);

		int[][] c = new int[10][10];
		for(int i = 0; i < 10; i++) {
			String[] currLine = br.readLine().split(" ");
			for(int j = 0; j < 10; j++) {
				c[i][j] = Integer.parseInt(currLine[j]);
			}
		}

		int[][] a = new int[h][w];
		for(int i = 0; i < h; i++) {
			String[] currLine = br.readLine().split(" ");
			for(int j = 0; j < w; j++) {
				a[i][j] = Integer.parseInt(currLine[j]);
			}
		}

		// int[][] dist = new int[10][10];
		for (int k = 0; k < 10; k++)   {  
	        for (int i = 0; i < 10; i++)  {  
	            for (int j = 0; j < 10; j++) {  
	                if (c[i][k] + c[k][j] < c[i][j])  
	                    c[i][j] = c[i][k] + c[k][j];  
	            }  
	        }  
	    }

	    int ans = 0;

	    for(int i = 0; i < h; i++) {
	    	for(int j = 0; j < w; j++) {
	    		if(a[i][j] != -1 && a[i][j] != 1) {
	    			ans += c[a[i][j]][1];
	    		}
	    	}
	    }

	    System.out.println(ans);
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

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

 
int main(){
   int H, W; cin >> H >> W;
   int ans;
  vector<vector <int>> c(10, vector<int> (10));
  vector<vector <int>> A(H, vector<int> (W));
  
  rep(i,10){rep(j,10){
    cin >> c[i][j];}}
   rep(i,H){rep(j,W){
    cin >> c[H][W];}}
  
  rep(i,10) rep(j,10) rep(k,10) c[i][j] = min(c[i][j] , c[i][k] +c[k][j]);
  
  rep(i,H){rep(j,W){
    if(A[i][j] == -1) continue;
    ans += c[a[i][j]][1];
  }}
  cout << ans << endl;
}
      
  
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: 'a' was not declared in this scope
   22 |     ans += c[a[i][j]][1];
      |              ^
Language: C++

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

int main() {

  int H,W;
  cin >> H >> W;

  vector<vector<int>> c(10,vector<int>(10)),A(H+1,vector<int>(W+1));

  for(int i = 0;i < 10;i++) {
    for(int j = 0;j < 10;j++) {
      cin >> c.at(i).at(j);
    }
  }

  
  for(int i = 1;i <= H;i++) {
    for(int j = 1;j <= W;j++) {
      cin >> A.at(i).at(j);
    }
  }

  int d[10],seen[10],D[10];

  D[1] = 0;

  for(int k = 0;k < 10;k++) {
    priority_queue<pair<int,int>> PQ;

    for(int i = 0;i < 10;i++) {
      d[i] = 100000000;
      seen[i] = 0;
    }

    PQ.push(make_pair(0,k));
    d[k] = 0;

    while(!PQ.empty()) {

      int u;
      pair<int,int> p = PQ.top();
      PQ.pop();
      u = p.second;

      seen[u] = 1;
      if(d[u] < p.first * (-1)) continue;

      if(seen[1]) {
        D[k] = d[1];
        break;
      }

      for(int i = 0;i < 10;i++) {
        if(!seen[i] && d[i] > d[u] + c.at(u).at(i))   {
          d[i] = d[u] + c.at(u).at(i);
          PQ.push(make_pair(d[i]*(-1),i));
        }
      }
    }
  }

  int ans = 0;
  for(int i = 1;i <= H;i++) {
    for(int j = 1;j <= W;j++) {
      if(A.at(i).at(j) != -1) ans += D[A.at(i).at(j)];
    }
  }

  cout << ans << endl;
}

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

int main() {

  int H,W;
  cin >> H >> W;

  vector<vector<int>> c(10,vector<int>(10)),A(H+1,vector<int>(W+1));

  for(int i = 0;i < 10;i++) {
    for(int j = 0;j < 10;j++) {
      cin >> c.at(i).at(j);
    }
  }

  
  for(int i = 1;i <= H;i++) {
    for(int j = 1;j <= W;j++) {
      cin >> A.at(i).at(j);
    }
  }

  int d[10],seen[10],D[10];

  D[1] = 0;

  for(int k = 0;k < 10;k++) {
    priority_queue<pair<int,int>> PQ;

    for(int i = 0;i < 10;i++) {
      d[i] = 100000000;
      seen[i] = 0;
    }

    PQ.push(make_pair(0,k));
    d[k] = 0;

    while(!PQ.empty()) {

      int u;
      pair<int,int> p = PQ.top();
      PQ.pop();
      u = p.second;

      seen[u] = 1;
      if(d[u] < p.first * (-1)) continue;

      if(seen[1]) {
        D[k] = d[1];
        break;
      }

      for(int i = 0;i < 10;i++) {
        if(!seen[i] && d[i] > d[u] + c.at(u).at(i))   {
          d[i] = d[u] + c.at(u).at(i);
          PQ.push(make_pair(d[i]*(-1),i));
        }
      }
    }
  }

  int ans = 0;
  for(int i = 1;i <= H;i++) {
    for(int j = 1;j <= W;j++) {
      if(A.at(i).at(j) != -1) ans += D[A.at(i).at(j)];
    }
  }

  cout << ans << endl;
}



Compiler output:
a.cc:78:5: error: redefinition of 'int main()'
   78 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <string.h>
#include <tuple>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

using namespace std;

typedef int64_t ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tupiii;
typedef tuple<ll, ll, ll> tuplll;

const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;

template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
void SWAP(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
void SWAP(int& a, int& b) { a ^= b; b ^= a; a ^= b; }


class D {
	int h, w;
	static const int v{ 10 };
	int H, W, C[10][10];

public:
	D()
	{
		cin >> H >> W;
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				cin >> C[i][j];
			}
		}
	}

	void init()
	{
		//for (int k = 0; k < 10; k++) {
		//	for (int i = 0; i < 10; i++) {
		//		for (int j = 0; j < 10; j++) {
		//			C[i][j] = min(C[i][j], C[i][k] + C[k][j]);
		//		}
		//	}
		//}

		REP(k, v)
			REP(i, v)
			REP(j, v)
			C[i][j] = min(C[i][j], C[i][k] + C[k][j]);

	void solve()
	{
		init();

		long long ret = 0;
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				int x;
				cin >> x;
				if (~x) ret += C[x][1];
			}
		}

		cout << ret << endl;

	}
};


int main()
{
	D solution;
	solution.solve();

	return 0;
}

Compiler output:
a.cc:104:2: error: expected '}' at end of input
  104 | }
      |  ^
a.cc:48:9: note: to match this '{'
   48 | class D {
      |         ^
a.cc: In member function 'void D::init()':
a.cc:80:9: error: a function-definition is not allowed here before '{' token
   80 |         {
      |         ^
a.cc: In member function 'int D::main()':
a.cc:101:18: error: 'class D' has no member named 'solve'
  101 |         solution.solve();
      |                  ^~~~~
a.cc: At global scope:
a.cc:104:2: error: expected unqualified-id at end of input
  104 | }
      |  ^
Language: C++

// https://atcoder.jp/contests/abc079/tasks/abc079_d
#include <bits/stdc++.h>

#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>

using namespace std;
using namespace boost;
using ll = long long;
using pii = pair<int, int>;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int read() {
    int tmp = 0;
    char c = getchar(), f = 1;
    while (c < '0' || '9' < c) {
        if (c == '-')
            f = -1;
        c = getchar();
    }
    while ('0' <= c && c <= '9') {
        tmp = tmp * 10 + c - '0';
        c = getchar();
    }
    return tmp * f;
}

const int SZ = 10;
int cost[SZ][SZ], mcost[SZ][SZ];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int h, w, t;
    h = read();
    w = read();
    REP(i, SZ) REP(j, SZ) cost[i][j] = read();
    vector<vector<int>> v(h);
    REP(i, h) REP(j, w) {
        r = read();
        v[i].push_back(t);
    }
    // undirectedS は無向グラフ、directedS は有向グラフ
    adjacency_list<listS, vecS, directedS, no_property,
                   property<edge_weight_t, int>>
        graph1(SZ);
    REP(i, SZ) REP(j, SZ) {
        if (i != j) {
            add_edge(i, j, cost[i][j], graph1);
        }
    }

    // k からの最短距離を求める
    vector<int> dist(SZ);
    vector<int> par(SZ);
    REP(i, SZ) {
        dijkstra_shortest_paths(
            graph1, i, distance_map(dist.data()).predecessor_map(par.data()));
        REP(j, SZ) {
            mcost[i][j] = dist[j];
            // cout << mcost[i][j] << " ";
        }
        // cout << endl;
    }
    ll sum = 0;
    REP(i, h) REP(j, w) {
        int a = v[i][j];
        if (a >= 2 || a == 0) {
            sum += mcost[a][1];
        }
    }
    cout << sum << endl;

    return 0;
}


Compiler output:
a.cc:4:10: fatal error: boost/graph/adjacency_list.hpp: No such file or directory
    4 | #include <boost/graph/adjacency_list.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

3 5
0 4 3 6 2 7 2 5 3 3
4 0 5 3 7 5 3 7 2 7
5 7 0 7 2 9 3 2 9 1
3 6 2 0 2 4 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 3 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
3 5 2 6 1
2 5 3 2 1
6 9 2 5 6


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

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


int main() {
	int h, w,ret=0;
	bool flg = true;
	cin >> h>>w;
	int c[10][10], d[10][10];
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			cin >> c[i][j];
		}
	}


	memcpy(d, c, sizeof(d));
	while (flg) {
		flg = false;
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				for (int k = 0; k < 10; k++) {
					if (i == j || i == k || j == k)	continue;
					if (d[i][j] > d[i][k] + d[k][j]) {
						d[i][j] = d[i][k] + d[k][j];
					}
				}
				if (c[i][j] != d[i][j]) {
					flg = true;
					c[i][j] = d[i][j];
				}
			}
		}
	}

	vector<vector<int>> a(h, vector<int>(w));
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cin >> a[i][j];
			if (a[i][j] >= 0) {
				ret += c[a[i][j]][1];
			}
		}
	}

	cout << ret << endl;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INTINF = 1<<30;
const int MOD = 1000000007;

void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int H,W,C[10][10], A[202][202];
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> H >> W;
    rep(i,10) rep(j,10) cin >> C[i][j];
    rep(y,H) rep(x,W) cin >> A[y][x];

    rep(k,10) rep(i,10) rep(j,10) c[i][j] = min(C[i][j], C[i][k] + C[k][j]);
    int ans = 0;
    rep(y,H) rep(x,W) if( 0 <= A[y][x]) ans += C[A[y][x]][1];
    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:35: error: 'c' was not declared in this scope
   31 |     rep(k,10) rep(i,10) rep(j,10) c[i][j] = min(C[i][j], C[i][k] + C[k][j]);
      |                                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
signed main(){
  int a,b;
  cin>>a>>b;
  vector<vector<int>> c(10,vector<int>(10)),d(a,vector<int>(b));
  fo(i,10){
    fo(i,10)
      cin>>c[i][j];
  }
  fo(i,a){
    fo(i,b)
      cin>>d[i][j];
  }
  vector<int> e(10);
  fo(i,10){
    fo(j,10){
      fo(k,10){
        c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
      }
    }
  }
  int f=0;
  fo(i,a){
    fo(j,b){
      if(d[i][j]!=-1)
        f+=c[d[i][j]][1];
    }
  }
  cout<<f<<endl;
}
        

Compiler output:
a.cc: In function 'int main()':
a.cc:79:17: error: 'j' was not declared in this scope
   79 |       cin>>c[i][j];
      |                 ^
a.cc:83:17: error: 'j' was not declared in this scope
   83 |       cin>>d[i][j];
      |                 ^
Language: C++

#include <iostream>
#include <string>
#include <queue>
#include <utility>
#include <algorithm>
#include <numeric>
#include <set>
#include <climits>
#include <map>

using namespace std;

int c[10][10];
int A[200][200];
int dst[10];
int main(){
  int H;
  int W;
  cin >> H >> W;
  for(int i = 0; i < 10; i++){
    for(int j = 0; j < 10; j++){
      cin >> c[i][j];
    }
  }

  for(int i = 0; i < 10; i++){
    dst[i] = -1;
  }
  dst[1] = 0;


  for(int i = 0; i < 10; i++){
    for(int j = 0; j < 10; j++){
      for(int k = 0; k < 10; k++){
        if(dst[j] >= 0){
          if(dst[k] < 0){
            dst[k] = dst[j] + c[k][j];
          } else {
            dst[k] = min(dst[k], dst[j] + c[k][j]);
          }
        }
      }
    }
  }

  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      cin >> A[i][j];
    }
  }

  int ans = 0;
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(A[i][j] >= 0){
        ans += dst[A[i][j]];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
3 5
0 4 3 6 2 7 2 5 3 3
4 0 5 3 7 5 3 7 2 7
5 7 0 7 2 9 3 2 9 1
3 6 2 0 2 4 6 4 2 3
3 5 7 4 0 6 9 7 6 7
9 8 5 2 2 0 4 7 6 5
5 4 6 3 2 3 0 5 4 3
3 6 2 3 4 2 4 0 8 9
4 6 5 4 3 5 3 2 0 8
2 1 3 4 5 7 8 6 4 0
3 5 2 6 1
2 5 3 2 1
6 9 2 5

Compiler output:
a.cc:63:1: error: expected unqualified-id before numeric constant
   63 | 3 5
      | ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
#define int long long
#define FOR(i,a,n) for(ll (i)=(a);(i)<(n);(i)++)
#define eFOR(i,a,n) for(ll (i)=(a);(i)<=(n);(i)++)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
constexpr auto INF = 1000000000;
constexpr auto LLINF = 1LL << 62;
constexpr auto mod = 1000000007;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; }return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; }return 0; }

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

    int h, w;
    cin >> h >> w;
    vector<vector<pair<int, int>>> edge(10);
    vector<VI> dis(10, VI(10, INF));
    int c;
    FOR(i, 0, 10)FOR(j, 0, 10) {
        cin >> c;
        if (i == j)continue;
        edge[i].push_back({ j,c });
        dis[i][j] = c;
    }
    VI a(h* w);
    FOR(i, 0, h* w)cin >> a[i];

    FOR(i, 0, 10)dis[i][i] = 0;
    FOR(i, 0, 10)FOR(j, 0, 10)FOR(k, 0, 10)chmin(dis[i][j], dis[i][k] + dis[k][j]);

    ll ans = 0;
    for (int i : a)if (i > -1)ans += dis[i][1];
    cout << ans << "\n";
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

// O(V^3)
void warshall_floyd(int n, vector<vector<int> > &g) {
    for(int k = 0; k < n; ++k)
        for(int i = 0; i < n; ++i)
            for(int j = 0; j < n; ++j) g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
}

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int h,w; cin >> h >> w;
    vector<vector<int> > g(10, vector<int>(10));
    for(int i=0; i < 10; ++i)
        for(int j=0; j < 10; ++j) cin >> g[i][j];
    warshall_floyd(10, g);
    ll ans = 0; int tmp;
    for(int i=0; i < h; ++i){
        for(int j=0; j < w; ++j){
            cin >> tmp;
            if(tmp==-1) continue;
            ans += g[tmp][1];
        }
    }
    cout << ans << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'll' was not declared in this scope
   21 |     ll ans = 0; int tmp;
      |     ^~
a.cc:26:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |             ans += g[tmp][1];
      |             ^~~
      |             abs
a.cc:29:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |     cout << ans << '\n';
      |             ^~~
      |             abs
Language: C++

#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_D main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
// functions

#endif


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


    int H, W; cin >> H >> W;
    vvi C(10, vi(10));
    REP(i, 10)
        REP(j, 10) cin >> C[i][j];

    vvi A(H, vi(W));
    REP(i, H)
        REP(j, W) cin >> A[i][j];

    vvi es(10);
    map<pii, int> cost;
    REP(i,10){
        FOR(j,i+1,10){
            es[i].push_back(j);
            es[j].push_back(i);
            cost[pii(i, j)] = C[i][j];
            cost[pii(j, i)] = C[j][i];
        }
    }

    vvl dist;
    warshall(dist, es, cost);

    ll ans = 0;
    REP(i,H){
        REP(j,W){
            if (A[i][j] >= 0) {
                ans += dist[A[i][j]][1];
            }
        }
    }
    cout << ans << endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:5: error: 'warshall' was not declared in this scope
   54 |     warshall(dist, es, cost);
      |     ^~~~~~~~
Language: C++

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

// iからjに変換する最小コスト 0=<i,j=<9
int min_r (int i, int j, vector<vector<int>> cij) {
  int a = cij.at(i).at(j);
  int cost = a;
  if (i < 0 || i > 10 || j < 0 || j > 10) {
    cout << "error" << endl;
    return -1;
  }
  else if (i == j) {
    return 0;
  }
  else {
  	for (int k=0; k<10; k++) {
      int itk = cij.at(i).at(k);
      if (cost > itk) {
        int ktj = cij.at(k).at(j);
        if (cost > itk + ktj) {
          cost = itk + ktj;
        }
        else if (cost > itk + min_r(k,j,cij)) {
          cost = itk + min_r(k,j,cij)
        }
      }
    }
  	return cost;
  }
}
int main () {
  int H, W;
  cin >> H >> W;
  
  vector<vector<int>> cij;
  for (int i=0; i<10; i++) {
	for (int j=0; j<10; j++){
      cin >> cij.at(i).at(j);
    }
  }
  
  vector<vector<int>> aij;
  for (int i=0; i<H; i++) {
    for (int j=0; j<W; j++){
      cin >> aij.at(i).at(j);
    }
  }
  
  int power = 0;
  for (int i=0; i<H; i++) {
	for (int j=0; j<W; j++) {
      int n = aij.at(i).at(j);
      if(n > -1 && n != 1) {
        power += min_r(n, 1, cij);
      }
    }
  }
  
  cout << power << endl;
}


Compiler output:
a.cc: In function 'int min_r(int, int, std::vector<std::vector<int> >)':
a.cc:24:38: error: expected ';' before '}' token
   24 |           cost = itk + min_r(k,j,cij)
      |                                      ^
      |                                      ;
   25 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
#define MOD 1000000007
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

//全点対最短路問題
#define MAX_V 400
long long d[MAX_V][MAX_V];
long long V;
void warshall_floyd() {
    for(int k = 0; k < V; k++) {
        for(int i = 0; i < V; i++) {
            for(int j = 0; j < V; j++) {
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
}

int main() {
    int H, W;
    cin >> H >> W;
    V = 9;
    REP(i, N) {
        REP(j, N) {
            if(i != j) {
                d[i][j] = INF;
            } else {
                d[i][j] = 0;
            }
        }
    }
    REP(i, 9) {
        REP(j, 9) { cin >> d[i][j]; }
    }
    warshall_floyd();
    long long res = 0;
    REP(i, H) {
        REP(j, W) {
            int tmp;
            cin >> tmp;
            if(tmp != -1) {
                res += d[tmp][1];
            }
        }
    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:12: error: 'N' was not declared in this scope
   45 |     REP(i, N) {
      |            ^
a.cc:2:41: note: in definition of macro 'REP'
    2 | #define REP(i, n) for(ll i = 0; i < (ll)n; i++)
      |                                         ^
Language: C++

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

// iからjに変換する最小コスト
int min_r (int i, int j; vector<vector<int>> cij) {
  int a = cij.at(i).at(j);
  int cost = a;
  for (int k=0; k<10; k++) {
    int b = min_r(i, k, cij) + cij.at(k).at(j);
    if (a > b) cost = b;
  }
  return cost;
}
int main () {
  int H, W;
  cin >> H >> W;
  
  vector<vector<int>> cij;
  for (int i=0; i<10; i++) {
	for (int j=0; j<10; j++){
      cin >> cij.at(i).at(j);
    }
  }
  
  vector<vector<int>> aij;
  for (int i=0; i<H; i++) {
    for (int j=0; j<W; j++){
      cin >> aij.at(i).at(j);
    }
  }
  
  int power = 0;
  for (int i=0; i<H; i++) {
	for (int j=0; j<W; j++) {
      int n = aij.at(i).at(j);
      if(n > -1 && n != 1) {
        power += min_r(n, 1, cij);
      }
    }
  }
  
  cout << power << endl;
}


Compiler output:
a.cc:5:24: error: expected ')' before ';' token
    5 | int min_r (int i, int j; vector<vector<int>> cij) {
      |           ~            ^
      |                        )
a.cc:5:49: error: expected initializer before ')' token
    5 | int min_r (int i, int j; vector<vector<int>> cij) {
      |                                                 ^
a.cc: In function 'int main()':
a.cc:37:23: error: too many arguments to function 'int min_r(int, int)'
   37 |         power += min_r(n, 1, cij);
      |                  ~~~~~^~~~~~~~~~~
a.cc:5:5: note: declared here
    5 | int min_r (int i, int j; vector<vector<int>> cij) {
      |     ^~~~~
Language: C++

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

int main () {
  int H, W;
  cin >> H >> W;
  
  vector<vector<int>> cij;
  for (int i=0; i<9; i++) {
	for (int j=0; j<9; j++){
      cin >> cij.at(i).at(j);
    }
  }
  
  vector<vector<int>> aij
  for (int i=0; i<H; i++) {
    for (int j=0; j<W; j++){
      cin >> aij.at(i).at(j);
    }
  }
  
  int power = 0;
  for (int i=0; i<H; i++) {
	for (int j=0; j<W; j++) {
      int n = aij.at(i).at(j);
      if(n > -1) {
        power += cij.at(n).at(1);
      }
    }
  }
  
  cout << power << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected initializer before 'for'
   16 |   for (int i=0; i<H; i++) {
      |   ^~~
a.cc:16:17: error: 'i' was not declared in this scope
   16 |   for (int i=0; i<H; i++) {
      |                 ^
a.cc:25:15: error: 'aij' was not declared in this scope; did you mean 'cij'?
   25 |       int n = aij.at(i).at(j);
      |               ^~~
      |               cij
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<int, pii> pipii;

int dp[10][10];

void solve() {
  int r, c;
  cin >> r >> c;
  for(int i = 0; i < 10; i++) for(int j = 0; j < 10; j++) cin >> dp[i][j];
  for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
  for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
  for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
  int ret = 0;
  int t;
  for(int i = 0; i < r; i++) for(int j = 0; j < c; j++) {
    cin >> t;
    if(t >= 0) ret += dp[t][1];
  }
  cout << ret << "\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:26:22: error: 'n' was not declared in this scope
   26 |   for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
      |                      ^
a.cc:27:22: error: 'n' was not declared in this scope
   27 |   for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
      |                      ^
a.cc:28:22: error: 'n' was not declared in this scope
   28 |   for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

int inf = 1000000000;
int cost[10][10];
void floyd(){

    for(int k=0; k<10; k++){
        for(int i=0; i<10; i++){
            if(cost[i][k] == inf) continue;
            for(int j=0; j<10; j++){
                if(cost[k][j] == inf) continue;

                cost[i][j] = min(cost[i][j], cost[i][k]+cost[k][j]);
            }
        }
    }
}

int main(){
    int H, W; cin >> H >> W;
    vector<int> cnt(10, 0);

    for(int i=0; i<10; i++) for(int j=0; j<10; j++) cost[i][j] = inf;
    for(int i=0; i<10; i++) for(int j=0; j<10; j++) cin >> cost[i][j];
˜
    for(int i=0; i<H; i++) for(int j=0; j<W; j++){
        int a; cin >> a;
        if(a != -1) cnt[a]++;
    }

    floyd();

    ll ans = 0;
    for(int i=0; i<10; i++){
        if(cnt[i] == 0 || i == 1) continue;
        ans += cost[i][1]*cnt[i];
    }
    cout << ans << endl;
}

Compiler output:
a.cc:36:2: error: stray '\16' in program
   36 | <U+02DC><U+000E>
      |         ^~~~~~~~
a.cc: In function 'int main()':
a.cc:36:1: error: '\U000002dc' was not declared in this scope
   36 | ˜
      | ^
a.cc:37:18: error: 'i' was not declared in this scope
   37 |     for(int i=0; i<H; i++) for(int j=0; j<W; j++){
      |                  ^
a.cc:37:41: error: 'j' was not declared in this scope
   37 |     for(int i=0; i<H; i++) for(int j=0; j<W; j++){
      |                                         ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
typedef long long ll;


int dist[10][10];

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    REP(i,10) REP(j,10) cin >> dist[i][j];
    // dist : cost i to j
    REP(k,10) REP(i,10) REP(j,10) chmin(dist[i][j],dist[i][k] + dist[k][j]);
    ll ans = 0; int t;
    REP(i,n) REP(j,m){
        cin >> t;
        if(t==-1) continue;
        ans += dist[t][1];
    }
    cout << ans << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:35: error: 'chmin' was not declared in this scope
   20 |     REP(k,10) REP(i,10) REP(j,10) chmin(dist[i][j],dist[i][k] + dist[k][j]);
      |                                   ^~~~~
Language: C++

#include<iostream>
#include<string.h>

using namespace std;
const int inf = 1e7;
const int man = 5e2+10;
//int maze[man][man];
int vis[man],dis[man];
int c[15][15];
//int jishu[10];
int h,w;
/*
int dij(int u)
{
	memset(vis,0,sizeof(vis));
	for(int i =1 ;i <= 9 ;i++)
	{
		dis[i] = c[u][i];
	}
	vis[u] = 1;
	for(int i =1 ;i < 9;i++)//必须是小于9，不能等于，debug了好久。。。
	{
		int minn = inf ,v = -1;
		for(int j =1 ;j <= 9 ;j++)
		{
			if(!vis[j]&&dis[j]<minn)
			{
				v = j;
				minn = dis[j];
			}
		}
		vis[v] = 1;
		for(int j = 1; j <= 9 ;j++)
		{
			if(!vis[j])
			{
				dis[j] = min(dis[j],dis[v]+c[v][j]);
			}
		}
	}
	return dis[1];
}
*/

void floyd()
{
	for(int k = 1; k <= 9 ;k++)
	{
		for(int i = 1 ;i <= 9 ;i++)
		{
			for(int j =1;j<= 9 ;j++)
			{
				c[i][j] = min(c[i][j],c[i][k] + c[k][j]);
			}
		}
	}
}

void solve()
{
	cin >> h >> w

		for(int i = 0; i < 10 ;i++)
		{
			for(int j = 0 ;j < 10 ;j++)
			{
				cin >> c[i][j];
			}
		}
	//	memset(jishu,0,sizeof(jishu));
		int ans = 0;
		floyd();
		for(int i = 1 ; i <= w ;i++)
		{
			for(int j = 1; j<= h ;j++)
			{
				int a;
				cin >> a;
				ans += c[a][1];
			}
		}
		//cout << dij(8) << endl;
		cout << ans << endl;

	
}

int main()
{
	solve();
	return 0;
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:61:22: error: expected ';' before 'for'
   61 |         cin >> h >> w
      |                      ^
      |                      ;
   62 | 
   63 |                 for(int i = 0; i < 10 ;i++)
      |                 ~~~   
a.cc:63:32: error: 'i' was not declared in this scope
   63 |                 for(int i = 0; i < 10 ;i++)
      |                                ^
Language: C

#include<iostream>
#include<string.h>

using namespace std;
const int inf = 1e7;
const int man = 1e2+10;
int maze[man][man];
int vis[man],dis[man];
int c[15][15];
int jishu[10];
int h,w;

int dij(int u)
{
	memset(vis,0,sizeof(vis));
	for(int i =1 ;i <= 9 ;i++)
	{
		dis[i] = c[u][i];
	}
	vis[u] = 1;
	for(int i =1 ;i < 9;i++)//必须是小于9，不能等于，debug了好久。。。
	{
		int minn = inf ,v = -1;
		for(int j =1 ;j <= 9 ;j++)
		{
			if(!vis[j]&&dis[j]<minn)
			{
				v = j;
				minn = dis[j];
			}
		}
		vis[v] = 1;
		for(int j = 1; j <= 9 ;j++)
		{
			dis[j] = min(dis[j],dis[v]+c[v][j]);
		}
	}
	return dis[1];
}

void solve()
{
	while(cin >> h >> w)
	{
		for(int i = 0; i < 10 ;i++)
		{
			for(int j = 0 ;j < 10 ;j++)
			{
				cin >> c[i][j];
			}
		}
		memset(jishu,0,sizeof(jishu));
		for(int i = 1 ; i <= w ;i++)
		{
			for(int j = 1; j<= h ;j++)
			{
				cin >> maze[i][j];
				if(maze[i][j] > 1)
				{
					jishu[maze[i][j]]++;
				}
			}
		}
		int ans = 0;
		//cout << dij(8) << endl;
		for(int i = 1 ; i <= 9 ;i++)
		{
			if(jishu[i])
			{
				int k = jishu[i];
				ans= ans +dij(i)*k;
			}
		//	cout << jishu[i] << endl;
		}
		cout << ans << endl;
	}
	
}

int main()
{
	solve();
	return 0;
}


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

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

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

ll C[15][15];
//! iを1に変えるのに必要な魔力の最小値
ll T[15];

struct Node
{
    Node(ll c, int i)
        : cost(c), i(i)
    {
    }
    ll cost;
    int i;
};

int main()
{
    int H, W;
    cin >> H >> W;
    REP(i, 10)
    {
        REP(j, 10)
        {
            cin >> C[i][j];
        }
        T[i] = INF;
    }

    priority_queue<Node, vector<Node>, function<bool(Node, Node)>> q([](Node a, Node b) { return a.cost > b.cost; });
    q.push(Node(0, 1));
    while (!q.empty())
    {
        Node t = q.top();
        q.pop();
        if (T[i] <= t.cost)
            continue;
        T[t.i] = t.cost;
        REP(i, 10)
        {
            if (T[i] <= t.cost + C[i][t.i])
                continue;
            q.push(Node(t.cost + C[i][t.i], i));
        }
    }

    ll sum = 0;
    REP(h, H)
    {
        REP(w, W)
        {
            int a;
            cin >> a;
            if (a == -1)
                continue;
            sum += T[a];
        }
    }
    cout << sum << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:15: error: 'i' was not declared in this scope
   47 |         if (T[i] <= t.cost)
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>
#include <list>
#include <bitset>

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define reps(x,c) for(auto x:c)
#define all(x) begin(x), end(x)
#define pb(a) emplace_back(a) 
#define mp(a,b) make_pair((a),(b))
#define pl pair<ll,ll>
#define INF 2147483600
#define MOD 1000000007
#define fi first
#define se second
#define dbg(x) cout << #x"="<< (x) << endl
#define dbgv(x) cout<<#x<<endl;reps(y,x){cout<<y<<" ";}cout<<endl

const int V=10000;
using P=pair<int,int>;
vector<P> G[V];
int dist[V];
bool used[V];
void dijkstra(int s){
  fill_n(dist,V,INF);
  fill_n(used,V,false);
  priority_queue<P,vector<P>,greater<P>> q;
  q.push(P(0,s));
  while(!q.empty()){
    int d; int t;
    tie(d,t)=q.top();q.pop();
    if(used[t])continue;
    used[t]=true;dist[t]=d;
    for(P e: G[t]){
      if(dist[e.second]<=d+e.first)continue;
      q.push(P(d+e.first,e.second));
    }
  }
}

int main(){
  ll H,W;cin>>H>>W;
  ll w;
  FOR(i,0,10){
    FOR(j,0,10){
      cin>>w;．
      G[i].emplace_back(w,j);
    }
  }
  vector<ll> v(10);
  rep(i,10){
    dijkstra(i);
    v[i]=dist[1];
  }
    
  ll ans=0,a;
  rep(i,H){
    rep(j,W){
      cin>>a;
      if(a!=-1){
        ans+=v[a];
      }
    }
  }
  cout<<ans<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:14: error: '\U0000ff0e' was not declared in this scope
   57 |       cin>>w;．
      |              ^~
Language: C++

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


int main(void) {
	int h,w;
	cin >> h >> w;
	int majic[10][10];
	for(int i=0; i<10; i++){
		for(int j=0; j<10; j++){
			cin >> majic[i][j];
		}
	}
	for(int i=0; i<10; i++){
		for(int j=0; j<10; j++){
			for(int k=0; k<10; k++){
				if(majic[i][j]+majic[j][k]<majick[i][k])majic[i][k]=majic[i][j]+majic[j][k];
			}
		}
	}
	long long ans=0,temp; 
	for(int i=0; i<h; i++){
		for(int j=0; j<w; j++){
			cin >> temp;
			if(temp!=-1)ans+=majic[temp][1];
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:60: error: 'majick' was not declared in this scope; did you mean 'majic'?
   23 |                                 if(majic[i][j]+majic[j][k]<majick[i][k])majic[i][k]=majic[i][j]+majic[j][k];
      |                                                            ^~~~~~
      |                                                            majic
Language: C

#include<stdio.h>

int main(){
	int H,W;
	scanf("%d%d",&H,&W);
	int c[10][10];
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++)scanf("%d",&c[i][j]);
	}
	
	for(int k=0;i<10;i++){
		for(int i=0;j<10;j++){
			for(int j=0;k<10;k++){
				if(c[i][j]>c[i][k]+c[k][j])c[i][j]=c[i][k]+c[k][j];
			}
		}
	}
	int ans=0;
	for(int i=0;i<H*W;i++){
		int tmp;
		scanf("%d",&tmp);
		if(tmp!=-1)ans+=c[tmp][1];
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:21: error: 'i' undeclared (first use in this function)
   11 |         for(int k=0;i<10;i++){
      |                     ^
main.c:11:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:29: error: 'j' undeclared (first use in this function)
   12 |                 for(int i=0;j<10;j++){
      |                             ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

#define MAX_V 1000000
int d[MAX_V][MAX_V];
int V;
void warshall_floyd() {
	rep(k, 0, V) rep(i, 0, V) rep(j, 0, V) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W;
	cin >> H >> W;
	V = 10;

	rep(i, 0, 10) rep(j, 0, 10) {
		if(i == j) d[i][j] = 0;
		else d[i][j] = 1000000;
	}

	rep(i, 0, 10) rep(j, 0, 10) cin >> d[i][j];

	warshall_floyd();
	
	int count[10];
	memset(count, 0, sizeof(count));
	rep(i, 0, H) rep(j, 0, W) {
		int a;
		cin >> a;
		count[a]++;
	}

	int ans = 0;
	rep(i, 0, 10) {
		if(i == 1) continue;
		ans += (count[i] * d[i][1]);
	}
	cout << ans << endl;

}


Compiler output:
/tmp/ccMrekHD.o: in function `warshall_floyd()':
a.cc:(.text+0xe5): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccMrekHD.o
a.cc:(.text+0xf8): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccMrekHD.o
a.cc:(.text+0x10b): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccMrekHD.o
/tmp/ccMrekHD.o: in function `main':
a.cc:(.text+0x16c): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccMrekHD.o
collect2: error: ld returned 1 exit status