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


#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(int argc, char* argv[]){
    int h, w;
    int c[10][10] = {};
    int a[201][201] = {};
    cin >> h >> w;
    rep(i, 10){
        rep(j, 10){
            cin >> c[i][j];
        }
    }
    rep(i, h){
        rep(j, w){
            cin >> a[i][j];
        }
    }

    rep(i, 10){
        rep(j, 10){
            rep(k, 10){
                c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
            }
        }
    }

    int sum = 0;
    rep(i, h){
        rep(j, w){
            if(a[i][j] > 0) sum += c[a[i][j]][1];
        }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:14:9: error: 'i' was not declared in this scope
   14 |     rep(i, 10){
      |         ^
a.cc:4:29: note: in definition of macro 'rep'
    4 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                             ^~~~~~~~~~~
a.cc:4:41: error: 'repi' was not declared in this scope
    4 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                                         ^~~~
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(i, 10){
      |     ^~~
a.cc:4:46: error: '_rep' was not declared in this scope
    4 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                                              ^~~~
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(i, 10){
      |     ^~~
a.cc:4:51: error: expected primary-expression before ')' token
    4 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                                                   ^
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(i, 10){
      |     ^~~
a.cc:4:18: error: '_overload3' was not declared in this scope
    4 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                  ^~~~~~~~~~
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(i, 10){
      |     ^~~
a.cc:4:51: error: expected primary-expression before ')' token
    4 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                                                   ^
a.cc:19:5: note: in expansion of macro 'rep'
   19 |     rep(i, h){
      |     ^~~
a.cc:4:51: error: expected primary-expression before ')' token
    4 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                                                   ^
a.cc:25:5: note: in expansion of macro 'rep'
   25 |     rep(i, 10){
      |     ^~~
a.cc:4:51: error: expected primary-expression before ')' token
    4 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                                                   ^
a.cc:34:5: note: in expansion of macro 'rep'
   34 |     rep(i, h){
      |     ^~~
Language: C++

import qualified Data.ByteString.Char8 as B
import qualified Data.Array.IO as A
import Control.Monad
import Data.Maybe

main :: IO ()
main = do
    [h, w] <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine
    cost <- A.newListArray ((0,0),(9,9)) . concat =<< replicateM 10
        (map (fst . fromJust . B.readInt) . B.words <$> B.getLine) :: IO (A.IOUArray (Int,Int) Int)

    square <- concat <$> replicateM h 
        (map (fst . fromJust . B.readInt) . B.words <$> B.getLine) :: IO [Int]

    forM_ [0..9] $ \i -> do
        A.writeArray cost (i,i) 0

    cost' <- warshallFloyd cost

    print . sum =<< forM square (\i -> if i == (-1) then return 0 else do
        c <- A.readArray cost' (i, 1)
        return c)

warshallFloyd :: A.IOUArray (Int, Int) Int
               -> IO (A.IOUArray (Int, Int) Int)
warshallFloyd arr = do
    forM_ [(i,j,k)|i<-[0..9], j<-[0..9], k<-[0..9]] $ \(i,j,k) -> do
        ik <- A.readArray arr (i,k)     
        ij <- A.readArray arr (i,j)     
        jk <- A.readArray arr (j,k)     
        when (ik > ij+jk) $ A.writeArray arr (i,k) (ij+jk)
    return arr

Compiler output:
a.cc:15:12: error: too many decimal points in number
   15 |     forM_ [0..9] $ \i -> do
      |            ^~~~
a.cc:15:20: error: stray '\' in program
   15 |     forM_ [0..9] $ \i -> do
      |                    ^
a.cc:18:9: warning: missing terminating ' character
   18 |     cost' <- warshallFloyd cost
      |         ^
a.cc:18:9: error: missing terminating ' character
   18 |     cost' <- warshallFloyd cost
      |         ^~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:34: error: stray '\' in program
   20 |     print . sum =<< forM square (\i -> if i == (-1) then return 0 else do
      |                                  ^
a.cc:21:30: warning: missing terminating ' character
   21 |         c <- A.readArray cost' (i, 1)
      |                              ^
a.cc:21:30: error: missing terminating ' character
   21 |         c <- A.readArray cost' (i, 1)
      |                              ^~~~~~~~
a.cc:27:24: error: too many decimal points in number
   27 |     forM_ [(i,j,k)|i<-[0..9], j<-[0..9], k<-[0..9]] $ \(i,j,k) -> do
      |                        ^~~~
a.cc:27:35: error: too many decimal points in number
   27 |     forM_ [(i,j,k)|i<-[0..9], j<-[0..9], k<-[0..9]] $ \(i,j,k) -> do
      |                                   ^~~~
a.cc:27:46: error: too many decimal points in number
   27 |     forM_ [(i,j,k)|i<-[0..9], j<-[0..9], k<-[0..9]] $ \(i,j,k) -> do
      |                                              ^~~~
a.cc:27:55: error: stray '\' in program
   27 |     forM_ [(i,j,k)|i<-[0..9], j<-[0..9], k<-[0..9]] $ \(i,j,k) -> do
      |                                                       ^
a.cc:1:1: error: 'import' does not name a type
    1 | import qualified Data.ByteString.Char8 as B
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <vector>
#include <queue>
#include <climits>

struct Node {
  // このノードから伸びるエッジの情報
  int number;
  std::vector<int> edges_to;    // 各エッジの接続先のノード番号
  std::vector<int> edges_cost;  // 各エッジのコスト

  // ダイクストラ法のためのデータ
  bool done;  // 確定ノードか否か
  int cost;   // このノードへの現時点で判明している最小コスト
  Node() {
    done = false;
    cost = INT_MAX;
  }
  bool operator> (const Node &node) const {
    return cost > node.cost;
  }
};

class MyGraph {
public:
  MyGraph(int numNodes) {
    this->numNodes = numNodes;
    nodes = std::vector<Node>(numNodes);
    doneCount = 0;
  }
  int numNodes;
  std::vector<Node> nodes;
  std::priority_queue<Node, std::vector<Node>, std::greater<Node> > queue;
  int doneCount;

  void addEdge(int edge_from, int edge_to, int edge_cost) {
    nodes[edge_from].number = edge_from;
    nodes[edge_from].edges_to.push_back(edge_to);
    nodes[edge_from].edges_cost.push_back(edge_cost);
  }
  void updateCost(int node_start) {
    nodes[node_start].cost = 0;
    queue.push(nodes[node_start]);
    while (!queue.empty()) {
      Node &node = nodes[queue.top().number];
      queue.pop();
      if (node.done) {
        continue;
      }
      //printf("%d\n", node.number);
      node.done = true;
      doneCount++;
      for (int i = 0; i < (int)node.edges_to.size(); ++i) {
        Node &nodeNext = nodes[node.edges_to[i]];
        if (!nodeNext.done && nodeNext.cost > node.cost + node.edges_cost[i]) {
          nodeNext.cost = node.cost + node.edges_cost[i];
          //printf("%d %d\n", nodeNext.number, node.cost + node.edges_cost[i]);
          queue.push(nodeNext);
        }
      }
    }
  }
  int getCost(int node_num) {
    return nodes[node_num].cost;
  }
};

int main(int argc, char const *argv[]) {
  int H, W;
  scanf("%d%d", &H, &W);
  int A[H][W];
  int c;
  MyGraph graph = MyGraph(10*10);
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      scanf("%d", &c);
      if (i != j) {
        graph.addEdge(j, i, c);
      }
    }
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      scanf("%d", &A[i][j]);
    }
  }
  graph.updateCost(1);
  int cost = 0;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (A[i][j] != -1) {
        cost += graph.getCost(A[i][j]);
        // printf(" %d\n", graph.getCost(A[i][j]));
      }
    }
  }
  printf("%d\n", cost);
  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:69:3: error: 'scanf' was not declared in this scope
   69 |   scanf("%d%d", &H, &W);
      |   ^~~~~
a.cc:96:3: error: 'printf' was not declared in this scope
   96 |   printf("%d\n", cost);
      |   ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <climits>
  +++ |+#include <cstdio>
    4 |
Language: C++

#include <iostream>
#define r(i,n)for(int i=0;i<=n;i++)
main() {int h,w,y[15][15],a,s=0;std::cin>>h>>w;r(i,9)r(j,9)std::cin>>y[i][j];r(k,9)r(i,9)r(j,9)y[i][j]=min(y[i][j],y[i][k]+y[k][j]);r(i,h-1)r(j,w-1){cin>>a;if(a!=-1)s+=y[a][1];}std::cout<<s;}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main() {int h,w,y[15][15],a,s=0;std::cin>>h>>w;r(i,9)r(j,9)std::cin>>y[i][j];r(k,9)r(i,9)r(j,9)y[i][j]=min(y[i][j],y[i][k]+y[k][j]);r(i,h-1)r(j,w-1){cin>>a;if(a!=-1)s+=y[a][1];}std::cout<<s;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:104: error: 'min' was not declared in this scope; did you mean 'std::min'?
    3 | main() {int h,w,y[15][15],a,s=0;std::cin>>h>>w;r(i,9)r(j,9)std::cin>>y[i][j];r(k,9)r(i,9)r(j,9)y[i][j]=min(y[i][j],y[i][k]+y[k][j]);r(i,h-1)r(j,w-1){cin>>a;if(a!=-1)s+=y[a][1];}std::cout<<s;}
      |                                                                                                        ^~~
      |                                                                                                        std::min
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:3:150: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 | main() {int h,w,y[15][15],a,s=0;std::cin>>h>>w;r(i,9)r(j,9)std::cin>>y[i][j];r(k,9)r(i,9)r(j,9)y[i][j]=min(y[i][j],y[i][k]+y[k][j]);r(i,h-1)r(j,w-1){cin>>a;if(a!=-1)s+=y[a][1];}std::cout<<s;}
      |                                                                                                                                                      ^~~
      |                                                                                                                                                      std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>

int main()
{  int i,j;
   int a[10][10];
   int row,column;
    printf("请输入
           9
           行与列");
    scanf("%d",&row);
   scanf("%d",&column);
   int b[row][column];
   printf("请输入数组a");
   for(i=0;i<10;i++)
    for(j=0;j<10;j++)
    scanf("%d",&a[i][j]);
    printf("请输入数组b");
    for(i=0;i<row;i++)
        for(j=0;j<column;j++)
    scanf("%d",&a[row-1][column-1]);
    printf("行与列为%d %d",row,column);
    for(i=0;i<10;i++)
        for(j=0;j<10;j++)
    printf("数组a为%d",a[i][j]);
    for(i=0;i<row;i++)
        for(j=0;j<column;j++)
    printf("数组b为%d",b[row-1][column-1]);


Compiler output:
main.c: In function 'main':
main.c:8:12: warning: missing terminating " character
    8 |     printf("请输入
      |            ^
main.c:8:12: error: missing terminating " character
    8 |     printf("请输入
      |            ^~~~~~~
main.c:9:13: error: expected ')' before '\U0000884c\U00004e0e\U00005217'
    9 |            9
      |             ^
      |             )
   10 |            行与列");
      |            ~~~~~~
main.c:8:11: note: to match this '('
    8 |     printf("请输入
      |           ^
main.c:10:18: warning: missing terminating " character
   10 |            行与列");
      |                  ^
main.c:10:18: error: missing terminating " character
   10 |            行与列");
      |                  ^~~
main.c:9:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
    9 |            9
      |            ^
      |            |
      |            int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:28:5: error: expected declaration or statement at end of input
   28 |     printf("数组b为%d",b[row-1][column-1]);
      |     ^~~~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
    int H, W, t, ans = 0;
    int c[10][10];

    cin >> H >> W;

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

    for (int k = 0; k < 10; k++) {
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                a[i][j] = min(a[i][j], a[i][k] + a[k][j]);
            }
        }
    }
    for (int i = 0; i < W; i++) {
        for (int j = 0; j < H; j++) {
            cin >> t;
            if (t != -1) { ans += a[1][t]; }
        }
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'a' was not declared in this scope
   20 |                 a[i][j] = min(a[i][j], a[i][k] + a[k][j]);
      |                 ^
a.cc:27:35: error: 'a' was not declared in this scope
   27 |             if (t != -1) { ans += a[1][t]; }
      |                                   ^
Language: C++

// Atcoder.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <cmath>

#define	MOD 1000000007;
#define PI 3.14159265358979323846;
#define rep(i,m,n) for(int i = m;i<(int)n;i++)
using namespace std;
typedef long long ll;
ll mod = 1000000007;
static const int MAX = 100;
static const long long INFTY = (1LL << 32);

int n = 10;
int d[MAX][MAX];

void floyd() {
	for (int k = 0; k < n; k++)
	{
		for (int i = 0; i < n; i++)
		{
			if (d[i][k] == INFTY) continue;
			for (int j = 0; j < n; j++)
			{
				if (d[k][j] == INFTY) continue;
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
}

int main()
{
	int H, W;
	cin >> H >> W;
	rep(i, 0, 10)rep(j, 0, 10) { cin >> d[i][j]; };

	int m[200][200];
	rep(i, 0, H)rep(j, 0, W) { cin >> m[i][j]; };

	floyd();

	int sum = 0;
	rep(i, 0, H)
	{
		rep(j, 0, W) {
			if (m[i][j] != -1) {
				sum +=	d[m[i][j]][1];
			};
		}
	};

	cout << sum << endl;
	return 0;
}




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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,H,W,A,c[10][10];
  cin>>H>>W;
    for(int k=0;k<=9;i++){
      for(int i=0;i<=9;i++){
        for(int j=0;j<=9;i++){
          c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
        }
      }
    }
    for(int i=0;i<=H-1;i++){
      for(int j=0;j<=W-1;j++){
        cin>>A;
        a+=c[A>=0?A:1][1];
      }
    }
  cout<<a;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: 'i' was not declared in this scope
    6 |     for(int k=0;k<=9;i++){
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,H,W,A,c[10][10];
  cin>>H>>W;
    for(int k=0;k<=9;i++){
      for(int i=0;i<=9;i++){
        for(int j=0;j<=9;i++){
          c[i][j]=min(c[i][j],c[i][k]+c[k][j])
        }
      }
    }
    for(int i=0;i<=H-1;i++){
      for(int j=0;j<=W-1;j++){
        cin>>A;
        a+=c[A>=0?A:1][1];
      }
    }
  cout<<a;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: 'i' was not declared in this scope
    6 |     for(int k=0;k<=9;i++){
      |                      ^
a.cc:9:47: error: expected ';' before '}' token
    9 |           c[i][j]=min(c[i][j],c[i][k]+c[k][j])
      |                                               ^
      |                                               ;
   10 |         }
      |         ~
Language: C++

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

int c[11][11];

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int h, w;
  cin >> h >> w;
  for (int i = 0; i < 9; i++) {
    for (int j = 0; j < 9; j++) {
      cin >> c[i][j];
    }
  }
  for (int k = 0; k < 9; k++) {
    for (int i = 0; i < 9; i++) {
      for (int j = 0; j < 9; j++) {
        c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
      }
    }
  }
  int res = 0;
  for (int i = 1; i <= h; i++) {
    for (int j = 1; j <= w; j++) {
      cin >> a[i][j];
      if (a[i][j] == -1) a[i][j] = 1;
      res += c[a[i][j]][1];
    }
  }
  cout << res << endl;
  return 0;
}


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

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

int main(){
int h,w;
cin>>h>>w;
int d[10][10];
for(int i=0;i<10;i++)for(int j=0;j<10;j++)cin>>d[i][j];
for(int i=0;i<n;i++)for(int j=0;j<n;j++)for(int k=0;k<n;k++)d[j][k]=min(d[j][k],dp[j][i]+dp[i][k]);
int res=0;
for(int i=0;i<h;i++)for(int j=0;j<w;j++) {int a;cin>>a;if(a!=-1)res+=d[a][1];}
cout<<res<<endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'n' was not declared in this scope
    9 | for(int i=0;i<n;i++)for(int j=0;j<n;j++)for(int k=0;k<n;k++)d[j][k]=min(d[j][k],dp[j][i]+dp[i][k]);
      |               ^
a.cc:9:81: error: 'dp' was not declared in this scope; did you mean 'd'?
    9 | for(int i=0;i<n;i++)for(int j=0;j<n;j++)for(int k=0;k<n;k++)d[j][k]=min(d[j][k],dp[j][i]+dp[i][k]);
      |                                                                                 ^~
      |                                                                                 d
Language: C++

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

int main(){
int h,w;
cin>>h>>w;
int d[10][10];
for(int i=0;i<10;i<10;i++)for(int j=0;j<10;j++)cin>>d[i][j];
for(int i=0;i<n;i++)for(int j=0;j<n;j++)for(int k=0;k<n;k++)d[j][k]=min(d[j][k],dp[j][i]+dp[i][k]);
int res=0;
for(int i=0;i<h;i++)for(int j=0;j<w;j++) {int a;cin>>a;if(a!=-1)res+=d[a][1];}
cout<<res<<endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ')' before ';' token
    8 | for(int i=0;i<10;i<10;i++)for(int j=0;j<10;j++)cin>>d[i][j];
      |    ~                 ^
      |                      )
a.cc:8:23: error: 'i' was not declared in this scope
    8 | for(int i=0;i<10;i<10;i++)for(int j=0;j<10;j++)cin>>d[i][j];
      |                       ^
a.cc:8:39: error: 'j' was not declared in this scope
    8 | for(int i=0;i<10;i<10;i++)for(int j=0;j<10;j++)cin>>d[i][j];
      |                                       ^
a.cc:9:15: error: 'n' was not declared in this scope
    9 | for(int i=0;i<n;i++)for(int j=0;j<n;j++)for(int k=0;k<n;k++)d[j][k]=min(d[j][k],dp[j][i]+dp[i][k]);
      |               ^
a.cc:9:81: error: 'dp' was not declared in this scope; did you mean 'd'?
    9 | for(int i=0;i<n;i++)for(int j=0;j<n;j++)for(int k=0;k<n;k++)d[j][k]=min(d[j][k],dp[j][i]+dp[i][k]);
      |                                                                                 ^~
      |                                                                                 d
Language: C++

//2017.12.1
//ABC 079　ワーシャルフロイド法を用いる

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

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)

const int max_v = 200;
const int INF = 1000000;


int main() {
	int h, w, a, ans;
	cin >> h >> w;
	int cost[10][10];

	REP(i,10){
		REP(j,10){
			cin >> cost[i][j];
		}
	}


	//ワーシャルフロイドを実行
	for(int k=0; k<v; k++){
		for(i=0; i<v; i++){
			for(j=0; j<v; j++){
				cost[i][j] = min( cost[i][j], cost[i][k]+cost[k][j]);
			}
		}
	}

	REP(i,h){
		REP(j,w){
			cin >> a;
			if(a >= 0) ans += cost[a][1];

		}
	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:24: error: 'v' was not declared in this scope
   29 |         for(int k=0; k<v; k++){
      |                        ^
a.cc:30:21: error: 'i' was not declared in this scope
   30 |                 for(i=0; i<v; i++){
      |                     ^
a.cc:31:29: error: 'j' was not declared in this scope
   31 |                         for(j=0; j<v; j++){
      |                             ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
//#define MOD 1000000007
using namespace std;
int c[10][10];
int H, W, A, res;
int main()
{
	scanf("%d%d", &H, &W);
	for (int i = 0; i < 10; i++)
		for (int j = 0; j < 10; j++)
			scanf(%d", &c[i][j]);
	for (int k = 0; k < 10; k++)
		for (int i = 0; i < 10; i++)
			for (int j = 0; j < 10; j++)
				if (c[i][j] > c[i][k] + c[k][j])
					c[i][j] = c[i][k] + c[k][j];
	for (int i = 0; i < H; i++)
		for (int j = 0; j < W; j++)
		{
			scanf("%d", &A);
			if (A >= 0)res += c[A][1];
		}

Compiler output:
a.cc:14:33: warning: missing terminating " character
   14 |                         scanf(%d", &c[i][j]);
      |                                 ^
a.cc:14:33: error: missing terminating " character
   14 |                         scanf(%d", &c[i][j]);
      |                                 ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:31: error: expected primary-expression before '%' token
   14 |                         scanf(%d", &c[i][j]);
      |                               ^
a.cc:14:32: error: 'd' was not declared in this scope
   14 |                         scanf(%d", &c[i][j]);
      |                                ^
a.cc:15:25: error: 'k' was not declared in this scope
   15 |         for (int k = 0; k < 10; k++)
      |                         ^
a.cc:16:33: error: 'i' was not declared in this scope
   16 |                 for (int i = 0; i < 10; i++)
      |                                 ^
a.cc:17:41: error: 'j' was not declared in this scope
   17 |                         for (int j = 0; j < 10; j++)
      |                                         ^
a.cc:25:18: error: expected '}' at end of input
   25 |                 }
      |                  ^
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
Language: C++

#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#include <cstdio>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif

struct Buffer{
    int idx;
    char buf[1025];
    Buffer(){ init(); }
    void init(){ idx = 0; read(0, buf, 1024); }
    void check(){ if(idx == 1024){ init(); } }
    int next(){
        static char notDigits[256] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1, 0,0,0,0,0,0,0,0,0,0,};
        int ret = 0, sign = 1;
        while(check(), notDigits[(int)buf[idx]]){ idx++; }
        if(check(), buf[idx] == '-'){ sign = -1; idx++; }
        while(check(), !notDigits[(int)buf[idx]]){ ret = ret * 10 + buf[idx++] - '0'; }
        return sign * ret;
    }
};

ll cs[10][10];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    Buffer buf;
    int h = buf.next(), w = buf.next();
    // vector<vector<short>> cs(10, vector<short>(10));
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            cs[i][j] = buf.next();
        }
    }
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            for(int k = 0; k < 10; k++){
                cs[j][k] = min((ll)cs[j][k], cs[j][i] + cs[i][k]);
            }
        }
    }
    int ans = 0;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            int a = buf.next();
            prints(a);
            if(a != -1){
                ans += cs[a][1];
            }
        }
    }
    cout << ans << '\n';
}


Compiler output:
a.cc: In member function 'void Buffer::init()':
a.cc:32:27: error: 'read' was not declared in this scope; did you mean 'fread'?
   32 |     void init(){ idx = 0; read(0, buf, 1024); }
      |                           ^~~~
      |                           fread
Language: C++

#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#include <fcntl.h>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif

struct Buffer{
    int idx;
    char buf[1025];
    Buffer(){ init(); }
    void init(){ idx = 0; read(0, buf, 1024); }
    void check(){ if(idx == 1024){ init(); } }
    int next(){
        static char notDigits[256] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1, 0,0,0,0,0,0,0,0,0,0,};
        int ret = 0, sign = 1;
        while(check(), notDigits[(int)buf[idx]]){ idx++; }
        if(check(), buf[idx] == '-'){ sign = -1; idx++; }
        while(check(), !notDigits[(int)buf[idx]]){ ret = ret * 10 + buf[idx++] - '0'; }
        return sign * ret;
    }
};

ll cs[10][10];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    Buffer buf;
    int h = buf.next(), w = buf.next();
    // vector<vector<short>> cs(10, vector<short>(10));
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            cs[i][j] = buf.next();
        }
    }
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            for(int k = 0; k < 10; k++){
                cs[j][k] = min((ll)cs[j][k], cs[j][i] + cs[i][k]);
            }
        }
    }
    int ans = 0;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            int a = buf.next();
            prints(a);
            if(a != -1){
                ans += cs[a][1];
            }
        }
    }
    cout << ans << '\n';
}


Compiler output:
a.cc: In member function 'void Buffer::init()':
a.cc:32:27: error: 'read' was not declared in this scope; did you mean 'fread'?
   32 |     void init(){ idx = 0; read(0, buf, 1024); }
      |                           ^~~~
      |                           fread
Language: C++

# include <stdio >
# define rep(i,n) for(int (i )=0;( i)<(n );(i )++)
int c [10][10];
int H,W,A,res ;
int main ()
{
scanf ("% d%d",&H ,&W);
rep (i ,10) rep (j ,10) scanf ("% d",&c[i][j]);
rep (k ,10) rep (i ,10) rep (j ,10)
if(c[i][j]>c[i][k]+c[k][j])c[i][j]=c[i][k]+c[k][j];
rep (i,H)rep (j,W)
{
scanf ("% d",&A);
if(A >=0) res +=c[A ][1];
}
printf ("%d\n", res );
}

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

#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif

struct Buffer{
    int idx;
    char buf[1025];
    Buffer(){ init(); }
    void init(){ idx = 0; read(0, buf, 1024); }
    void check(){ if(idx == 1024){ init(); } }
    int next(){
        static char notDigits[256] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1, 0,0,0,0,0,0,0,0,0,0,};
        int ret = 0, sign = 1;
        while(check(), notDigits[(int)buf[idx]]){ idx++; }
        if(check(), buf[idx] == '-'){ sign = -1; idx++; }
        while(check(), !notDigits[(int)buf[idx]]){ ret = ret * 10 + buf[idx++] - '0'; }
        return sign * ret;
    }
};

ll cs[10][10];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    Buffer buf;
    int h = buf.next(), w = buf.next();
    // vector<vector<short>> cs(10, vector<short>(10));
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            cs[i][j] = buf.next();
        }
    }
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            for(int k = 0; k < 10; k++){
                cs[j][k] = min((ll)cs[j][k], cs[j][i] + cs[i][k]);
            }
        }
    }
    int ans = 0;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            int a = buf.next();
            prints(a);
            if(a != -1){
                ans += cs[a][1];
            }
        }
    }
    cout << ans << '\n';
}


Compiler output:
a.cc: In member function 'void Buffer::init()':
a.cc:31:27: error: 'read' was not declared in this scope; did you mean 'fread'?
   31 |     void init(){ idx = 0; read(0, buf, 1024); }
      |                           ^~~~
      |                           fread
Language: C++

# include <cstdio >
# define rep(i,n) for(int (i )=0;( i)<(n );(i )++)
int c [10][10];
int H,W,A,res ;
int main ()
{
scanf ("% d%d",&H ,&W);
rep (i ,10) rep (j ,10) scanf ("% d",&c[i][j]);
rep (k ,10) rep (i ,10) rep (j ,10)
if(c[i][j]>c[i][k]+c[k][j])c[i][j]=c[i][k]+c[k][j];
rep (i,H)rep (j,W)
{
scanf ("% d",&A);
if(A >=0) res +=c[A ][1];
}
printf ("%d\n", res );
}

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

//問題URL
//

//解き方メモ
//
    
#include<iostream>
#include<queue>
#include<utility>
#include<vector>
using namespace std;

int main(){
  int h,w;
  int c[10][10];
  int a[201][201];
  int cnt[10];
  int cost = 0;

  cin >> h >> w;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      cin >> c[i][j];
    }
  }

  memset(cnt,(int)0,sizeof(a));
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> a[i][j];
      if(a[i][j] != -1){
	cnt[ a[i][j] ]++;
      }
    }
  }

  for (int i = 0; i < 10; i++) {
    if(i!=1 && cnt[i]>0){
      priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> q;
      for (int j = 0; j < 10; j++) {
	//cost i -> j
	if(i != j){
	  //cout << c[i][j] << ":" << j << endl;
	  q.push(make_pair(c[i][j],j));
	}
      }
      while(true){
	pair<int,int> p = q.top();
	q.pop();
	//cout << p.first << ":" << p.second << ",";

	if(p.second == 1){
	  cost += cnt[i] * p.first;
	  break;
	} else {
	  for (int k = 0; k < 10; k++) {
	    if(k != p.second){
	      q.push(make_pair(p.first+c[p.second][k],k));
	    }
	  }
	}
      }
    }
  }

  cout << cost << endl;
  
  return 0;
}


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

#include <iostream>

using namespace std;

int main()
{
	int n,m,c[15][15];
	cin >> n >> m;
	memset(c,0,sizeof(c));
	for (int i = 0; i < 10; ++i)
		for (int j = 0; j < 10; ++j)
			cin >> c[i][j];
	
	for (int k = 0; k < 10; ++k) {
		for (int i = 0; i < 10; ++i) {
			for (int j = 0; j < 10; ++j) {
				if (i != j && 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 < n; ++i) {
		for (int j = 0; j < m; ++j) {
			int x;
			cin >> x;
			if (x != -1) {
				ans += c[x][1];
			}
		}
	}
	cout << ans << endl;
}

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

#include <iostream>

using namespace std;

const int INF = 100000000;
int c[10][10] = {0};
int d[10] = {0};

void bellman_ford(int s) {
    d[s] = 0;
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            for (int k = 0; k < 10; k++) {
                if (j == k) continue;
                int cost = c[k][j];
                if (d[j] != INF && d[k] > d[j] + cost) {
                    d[k] = d[j] + cost;
                }
            }
        }
    }
}

int main() {
    int H, W;
    int t, ans = 0;

    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++) {
        d[i] = INF;
    }

    bellman_ford(1);

    for (int i = 0; i < W; i++) {
        for (int j = 0; j < H; j++) {
            cin >> t;
            if (a != -1) {
                ans += d[t];
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:17: error: 'a' was not declared in this scope
   44 |             if (a != -1) {
      |                 ^
Language: C++

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

int main (){
    int H,W;
    cin >> H >> W;
    int c[10][10];
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            cin >> c[i][j];
        }
    }
    int a[H][W];
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin >> a[i][j];
        }
    }
    LL mini[10][10];
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            mini[i][j]=1000000000;
        }
    }
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            for(int k=0;k<10;k++){
                c[i][j]=min(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){
                ans+=c[a[i]][1];
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:23: error: invalid types 'int [10][10][int [W]]' for array subscript
   37 |                 ans+=c[a[i]][1];
      |                       ^
Language: C++

for(i=0; i<10; i++)
    {
        for(k=0; k<10; k++)
        {
            if(i!=k)
            {
                for(j=0; j<10; j++)
                {
                    ll tmp=dp[i][j]+dp[j][k];
                    if(tmp<dp[i][k])
                        dp[i][k]=tmp;
                }
            }
        }
    }

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for(i=0; i<10; i++)
      | ^~~
a.cc:1:10: error: 'i' does not name a type
    1 | for(i=0; i<10; i++)
      |          ^
a.cc:1:16: error: 'i' does not name a type
    1 | for(i=0; i<10; i++)
      |                ^
Language: C++

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

#define endl '\n'
#define d(x) cout << #x << " = " << (x) << endl;

struct st {
  pair<int, int> pos;
  int x, cost;
  st() {}
  st(int i, int j, int xx, int c) {
    pos = {i, j};
    x = xx;
    cost = c;
  }
};

int make_key (pair<int, int> x) {
  return x.first * 10 + x.second;
}

int solve (int x, vector<vector<int>> &wall, vector<vector<int>> &cost) {
  queue<st> q;
  q.push(st(-1, -1, x, 0));
  unordered_map<int, bool> visited;

  int mm = int_max;
  while (!q.empty()) {
    st cur = q.front(); q.pop();
    visited[make_key(cur.pos)] = true;
    if (cur.x == 1) {
      mm = min(mm, cur.cost);
      continue;
    }

    for (int k = 0; k < 10; ++k) {
      if (k == cur.x) continue;
      st next = st(cur.x, k, k, cur.cost + cost[cur.x][k]);
      if (visited.count(make_key(next.pos)) == 0) {
        q.push(next);
      }
    }
  }
  if (mm == int_max) assert(false);

  return mm;
}

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);
  int n, m;
  while (cin >> n >> m) {
    vector<vector<int>> cost(10);;
    for (int i = 0; i < 10; ++i) {
      for (int j = 0; j < 10; ++j) {
        int x;
        cin >> x;
        cost[i].push_back(x);
      }
    }

    vector<vector<int>> wall(n);
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        int x;
        cin >> x;
        wall[i].push_back(x);
      }
    }

    long long ans = 0;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        if (wall[i][j] == -1) continue;
        ans += solve(wall[i][j], wall, cost);
      }
    }

    cout << ans << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int solve(int, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&)':
a.cc:27:12: error: 'int_max' was not declared in this scope
   27 |   int mm = int_max;
      |            ^~~~~~~
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<string>
#include<sstream>
#include<algorithm>
int c[10][10];
long long int ans;
int map[201][201];
using namespace std;
int h, w;
int dfs(int a, int b) {
	for (int i = 0;i < 10;i++) {
			if (c[a][b] > c[i][b]) {
				c[a][b] = min(c[a][b],dfs(a,i)+c[i][b]);
			}
		}
	return c[a][b];
	}
int main() {
	cin >> h >> w;
	ans = 0;
	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++) {
		for (int j = 0;j < 10;j++) {
			if(c[i][j]>)
		}
	}



	for (int i = 0;i < h;i++) {
		for (int j = 0;j < w;j++) {
			cin >> map[i][j];
			if (map[i][j] == -1)continue;
			if (map[i][j] != 1) {
				ans += c[i][j];
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:36: error: expected primary-expression before ')' token
   28 |                         if(c[i][j]>)
      |                                    ^
a.cc:29:17: error: expected primary-expression before '}' token
   29 |                 }
      |                 ^
Language: C

#define _CRT_SECURE_NO_WARNINGS

//#define DEBUG
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int d[10][10];

void warshall_floyd(int n) { // nは頂点数
	for (int i = 0; i < n; i++)      // 経由する頂点
		for (int j = 0; j < n; j++)    // 開始頂点
			for (int k = 0; k < n; k++)  // 終端
				d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
}

int main() {
#ifdef DEBUG

#endif
	int INF = 99999999;
	int i, j;
	for (i = 0; i < 10; i++) {
		for (j = 0; j < 10; j++) {
			if (i == j) {
				d[i][j] = 0;
			}
			else {
				d[i][j] = INF;
			}
		}
	}

	int H, W;
	scanf("%d %d", &H, &W);

	int c[10][10];
	for (i = 0; i < 10; i++) {
		for (j = 0; j < 10; j++) {
			scanf("%d", &d[i][j]);
		}
	}

	warshall_floyd(10);
	/*
	printf("\n");
	for (i = 0; i < 10; i++) {
		for (j = 0; j < 10; j++) {
			printf("%d ", d[i][j]);
		}
		printf("\n");
	}
	/*/
	//*/
	int A;
	int ans = 0;
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			scanf("%d", &A);
			if (A == -1)continue;
			ans += d[A][1];
		}
	}
	printf("%d\n", ans);
}

Compiler output:
main.c: In function 'warshall_floyd':
main.c:14:43: error: implicit declaration of function 'min'; did you mean 'fmin'? [-Wimplicit-function-declaration]
   14 |                                 d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
      |                                           ^~~
      |                                           fmin
Language: C++

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

using namespace std;

int main()
{
	vector<vector<int>> M(10, vector<int>(10));
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			cin >> M[i][j];
		}
	}
	vector<vector<int>> V(n, vector<int>(m));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> V[i][j];
		}
	}
	for(int k=0;k<10;k++)
		for (int i = 0; i<10; i++)
			for (int j = 0; j<10; j++)
				if (M[i][j] < LONG_MAX)
					M[i][j] = min(M[i][j], M[i][k] + M[k][j]);
	int answer = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (V[i][j] == -1) continue;
			answer += M[V[i][j]][1];
		}
	}
	cout << answer;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:47: error: 'LONG_MAX' was not declared in this scope
   27 |                                 if (M[i][j] < LONG_MAX)
      |                                               ^~~~~~~~
a.cc:5:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <algorithm>
  +++ |+#include <climits>
    5 |
Language: C++

//raja1999
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 <<endl;prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx


using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
//#define iinf (3000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);
ll c[200][200],dp[200][200],c1[200];
int main(){
	std::ios::sync_with_stdio(false);
	int h,w,i,j,x,k.k1;
	ll val=0;
	cin>>h>>w;
	rep(i,10){
		rep(j,10){
			cin>>c[i][j];
		}
	}	
	rep(i,10){
		rep(j,10){
			if(i==j){
				dp[i][j]=0;
			}
			else{
				dp[i][j]=c[i][j];
			}
		}
	}	
	rep(i,h){
		rep(j,w){
			cin>>x;
			if(x!=-1){
				c1[x]++;
			}
		}
	}
	rep(i,10){
		rep(j,10){
			rep(k,10){
				dp[i][j]=min(dp[i][k]+dp[k][j],dp[i][j]);
			}
		}
	}
	rep(k1,100){
		rep(i,10){
			rep(j,10){
				rep(k,10){
					dp[i][j]=min(dp[i][k]+dp[k][j],dp[i][j]);
				}
			}
		}
	}
	rep(i,10){
		val+=c1[i]*dp[i][1];
	}
	cout<<val<<endl;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:50:24: error: expected initializer before '.' token
   50 |         int h,w,i,j,x,k.k1;
      |                        ^
a.cc:78:29: error: 'k' was not declared in this scope
   78 |                         rep(k,10){
      |                             ^
a.cc:22:22: note: in definition of macro 'f'
   22 | #define f(i,a,b) for(i=a;i<b;i++)
      |                      ^
a.cc:78:25: note: in expansion of macro 'rep'
   78 |                         rep(k,10){
      |                         ^~~
a.cc:83:13: error: 'k1' was not declared in this scope; did you mean 'y1'?
   83 |         rep(k1,100){
      |             ^~
a.cc:22:22: note: in definition of macro 'f'
   22 | #define f(i,a,b) for(i=a;i<b;i++)
      |                      ^
a.cc:83:9: note: in expansion of macro 'rep'
   83 |         rep(k1,100){
      |         ^~~
a.cc:86:37: error: 'k' was not declared in this scope
   86 |                                 rep(k,10){
      |                                     ^
a.cc:22:22: note: in definition of macro 'f'
   22 | #define f(i,a,b) for(i=a;i<b;i++)
      |                      ^
a.cc:86:33: note: in expansion of macro 'rep'
   86 |                                 rep(k,10){
      |                                 ^~~
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String X =sc.next();
        String Y =sc.next();
        int numX;
        int numY;
        
        if(X.equals("A")){
            numX=1;
        }else if(X.equals("B")){
            numX=2;
        }else if(X.equals("C")){
            numX=3;
        }else if(X.equals("D")){
            numX=4;
        }else if(X.equals("E")){
            numX=5;
        }else if(X.equals("F")){
            numX=6;
        }//else{
         //   numX=0;
        //}
        
        if(Y.equals("A")){
            numY=1;
        }else if(Y.equals("B")){
            numY=2;
        }else if(Y.equals("C")){
            numY=3;
        }else if(Y.equals("D")){
            numY=4;
        }else if(Y.equals("E")){
            numY=5;
        }else if(Y.equals("F")){
            numY=6;
        }//else{
           // numY=0;
            
        //}
        
        if(numX<numY){
            System.out.println("<");
        }else if(numX>numY){
            System.out.println(">");
        }else{
            System.out.println("=");
        }
        
        
   }
}


Compiler output:
Main.java:44: error: variable numX might not have been initialized
        if(numX<numY){
           ^
Main.java:44: error: variable numY might not have been initialized
        if(numX<numY){
                ^
2 errors
Language: C++

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

int main(){
  char a,b;
  cin >> a >> b;
  if(a>b) cout << ">";
  else if(a==b) cout << "=";
  else cout << "<"
}


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

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

int main() {
  char a, b;
  cin >> a >> b;
  if (a < b) cout << "<" << endl;
  else if (a == b) cout << "=" << encl;
  else cout << ">" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:35: error: 'encl' was not declared in this scope
    9 |   else if (a == b) cout << "=" << encl;
      |                                   ^~~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Scanner sc = new Scanner(System.in);
    	String s1 = sc.next();
        String s2 = sc.next();
        int n1 = (int)s1.charAt(0);
        int n2 = (int)s2.charAt(0);
        if(n1 > n2){
        	System.out.println(">");
        }else if(n1 < n2){
        	System.out.println("<");
        }else{
        	System.out.println("=");
        }
    }
}


Compiler output:
Main.java:6: error: variable sc is already defined in method main(String[])
        Scanner sc = new Scanner(System.in);
                ^
1 error