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

#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
#define ll long long

char a[10];
int num[4];

int main(){
    gets(a);

    for(int i=0;i<4;i++){
        num[i]=a[i]-'0';
    }

    if((num[0]-num[1]-num[2]-num[3])==7){
        cout<<num[0]<<"-"<<num[1]<<'-'<<num[2]<<'-'<<num[3]<<"=7"<<endl;
    }else if((num[0]-num[1]-num[2]+num[3])==7){
        cout<<num[0]<<"-"<<num[1]<<'-'<<num[2]<<'+'<<num[3]<<"=7"<<endl;
    }else if((num[0]-num[1]+num[2]-num[3])==7){
        cout<<num[0]<<"-"<<num[1]<<'+'<<num[2]<<'-'<<num[3]<<"=7"<<endl;
    }else if((num[0]-num[1]+num[2]+num[3])==7){
        cout<<num[0]<<"-"<<num[1]<<'+'<<num[2]<<'+'<<num[3]<<"=7"<<endl;
    }else if((num[0]+num[1]-num[2]-num[3])==7){
        cout<<num[0]<<"+"<<num[1]<<'-'<<num[2]<<'-'<<num[3]<<"=7"<<endl;
    }else if((num[0]+num[1]-num[2]+num[3])==7){
        cout<<num[0]<<"+"<<num[1]<<'-'<<num[2]<<'+'<<num[3]<<"=7"<<endl;
    }else if((num[0]+num[1]+num[2]-num[3])==7){
        cout<<num[0]<<"+"<<num[1]<<'+'<<num[2]<<'-'<<num[3]<<"=7"<<endl;
    }else if((num[0]+num[1]+num[2]+num[3])==7){
        cout<<num[0]<<"+"<<num[1]<<'+'<<num[2]<<'+'<<num[3]<<"=7"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   15 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
using namespace std;

typedef long long ll;

int a, b, c, d;

int main() {
	int n; cin >> n;
	a = n / 1000;
	b = (n / 100)%10;
	c = (n / 10) % 10;
	d = n % 10;
	for (int i = 0; i < 2; ++i) {
		int num;
		if (i == 0) num = a + b;
		else num = a - b;
		for (int j = 0; j < 2; ++j) {
			int s = num;
			if (j == 0) num += c;
			else num -= c;
			for (int k = 0; k < 2; ++k) {
				int t = num;
				if (k == 0) num += d;
				else num -= d;
				if (num == 7) {
					cout << a << (i == 0 ? "+" : "-") << b << (j == 0 ? "+" : "-") << c << (k == 0 ? "+" : "-") << d << "=7"<< endl;
					return 0;
				}
				num = t;
			}
			num = s;
		}
	}
	return 0;

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

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
int main(){
	string s;
	cin>>s;
	int a[4];
	rep(i,4) a[i] = s[i]-'0';
	rep(b,8){
		int x = a[0];
		string ans=s[0];
		rep(i,3){
			if((b>>i)&1){
				x += a[i+1];
				ans += '+';
				ans += s[i+1];
			}else{
				x -= a[i+1];
				ans += '-';
				ans += s[i+1];
			}
		}
		if(x==7){
			ans += "=7";
			cout<<ans<<endl;
			return 0;
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   21 |                 string ans=s[0];
      |                               ^
Language: C++

#include <bits/stdc++.h>

#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000000000000ll
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
//#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
/* clang-format on */

struct edge {
  ll from;
  ll to;
  ll cost;
};

// O(v^3) 負閉路にも使える
// vector<vector<ll>> dp(v, vector<ll>(v, INF)) dp[i][j]はiからjへのコスト
// https://qiita.com/ageprocpp/items/cdf67e828e1b09316f6e#%E3%83%80%E3%82%A4%E3%82%AF%E3%82%B9%E3%83%88%E3%83%A9%E6%B3%95
bool warshall_floyd(vector<vector<ll>> &dp, vector<edge> &edges, ll v) {
  ll e = edges.size();
  REP(i, e) { dp[edges[i].from][edges[i].to] = edges[i].cost; }
  REP(i, v) { dp[i][i] = 0; }

  REP(k, v) {
    REP(i, v) {
      REP(j, v) {
        if (dp[i][k] == INF || dp[k][j] == INF) continue;
        dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
      }
    }
  }

  REP(i, v) {
    //負閉路を持つ
    if (dp[i][i] < 0) return false;
  }
  return true;
}

int main() {
  // ios::sync_with_stdio(false);
  // cin.tie(nullptr);
  // v=頂点数,e=辺の数
  ll v, e, h, w;
  cin >> h >> w;
  v = 10, e = 100;
  vector<edge> edges(e);
  REP(i, 10) {
    REP(j, 10) {
      ll c;
      cin >> c;
      edges[i*10+j] = {i, j, c};
    }
  }
  vector<ll> cnt(10, 0);
  REP(i, h * w) {
    ll a;
    cin >> a;
    if (a != -1) cnt[a]++;
  }
  vector<vector<ll>> dist(v, vector<ll>(v, INF));
  warshall_floyd(dist, edges, v);
  ll ans = 0;
  REP(i, 10) {
    ans += cnt[i] * dist[i][1];
  }
  cout << ans << endl;
  return 0;
}


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

# include <bits/stdc++.h>
# define sz(x) (int)((x).size())
# define F first
# define S second
# define pb push_back
# define ub upper_bound
# define lb lower_bound
# define all(x) x.begin(), x.end()
# define pqueue priority_queue
# define mset multiset
# define umap unordered_map
# define Speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
# define rep(i,n) for(int i=0;i<n;++i)
# define forn(i,n) for(int i=1;i<=n;++i)
# define lr(i,l,r) for(int i=l;(l>r?i>=r:i<=r);(l>r?--i:++i))

using namespace std;

template<class T> void umin(T &a,T b){a=min(a,b);}
template<class T> void umax(T &a,T b){a=max(a,b);}

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

const int dx[]={1,0,-1,0,-1,-1,1,1},dy[]={0,1,0,-1,-1,1,-1,1}; 
const int mod = 1e9+7;
const ll N = 1e3+4;

ll dp[10],ans;
ll c[10][10];

void calc(int start,int x,int sum,int i){
	if(x==1){
		umin(dp[start],sum);
		return;
	}
	if(i>=9)return;
	for(int j=0;j<=9;++j){
		calc(start,j,sum+c[x][j],i+1);
	}
}

void solve(){
	int h,w;
	cin>>h>>w;
	for(int i=0;i<=9;++i)dp[i]=mod;
	for(int i=0;i<=9;++i){
		for(int j=0;j<=9;++j){
			cin>>c[i][j];
		}
	}	
	dp[1]=0;
	//calc(8,8,0,0);
	//cout<<dp[8]<<' ';
	for(int i=1;i<=h;++i){
		for(int j=1;j<=w;++j){
			int x;
			cin>>x;
			if(x!=-1){
				if(dp[x]==mod)calc(x,x,0,0);
				ans+=dp[x];
			}
		}
	}
	cout<<ans;

}

int main(){
	Speed();
	int T=1; 
	//cin>>T;	
	while(T--)
		solve();
	return 0;
}

Compiler output:
a.cc: In function 'void calc(int, int, int, int)':
a.cc:35:21: error: no matching function for call to 'umin(ll&, int&)'
   35 |                 umin(dp[start],sum);
      |                 ~~~~^~~~~~~~~~~~~~~
a.cc:19:24: note: candidate: 'template<class T> void umin(T&, T)'
   19 | template<class T> void umin(T &a,T b){a=min(a,b);}
      |                        ^~~~
a.cc:19:24: note:   template argument deduction/substitution failed:
a.cc:35:21: note:   deduced conflicting types for parameter 'T' ('long long int' and 'int')
   35 |                 umin(dp[start],sum);
      |                 ~~~~^~~~~~~~~~~~~~~
Language: C++

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

int c[15][15];
int cost[15];
int visit[15];

void dfs(int num, int start, int now=0){
  if(num==1){
    cost[start]=min(cost[start],now);
    return;
  }
  for(int i = 0; i <= 9; i++){
    visit[num]=1;
    if(visit[i]) continue;
    now+=c[num][i];
    dfs(i,start,now);
    now-=c[num][i];
    visit[i]=0;
  }
}

int main(){
  int h,w;
  cin>>h>>w;
  rep(i,10)rep(j,10){
    cin>>c[i][j];
  }
  map<int,int> mp;
  rep(i,h)rep(j,w){
    int a;
    cin>>a;
    if(a!=-1)mp[a]++;
  }
  rep(i,10) cost[i]=c[i][1];
  for(int i = 0; i <= 9; i++){
    if(i==1) continue;
    rep(j,10)visit[j]=0;
    dfs(i,i);
  }
  int ans=0;
  for(auto x : mp){
    ans += cost[x.first] * x.second;
  }
  cout<<ans<<endl;
}



Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:17:5: error: reference to 'visit' is ambiguous
   17 |     visit[num]=1;
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:5: note:                 'int visit [15]'
    9 | int visit[15];
      |     ^~~~~
a.cc:18:8: error: reference to 'visit' is ambiguous
   18 |     if(visit[i]) continue;
      |        ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:5: note:                 'int visit [15]'
    9 | int visit[15];
      |     ^~~~~
a.cc:22:5: error: reference to 'visit' is ambiguous
   22 |     visit[i]=0;
      |     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:5: note:                 'int visit [15]'
    9 | int visit[15];
      |     ^~~~~
a.cc: In function 'int main()':
a.cc:41:14: error: reference to 'visit' is ambiguous
   41 |     rep(j,10)visit[j]=0;
      |              ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:5: note:                 'int visit [15]'
    9 | int visit[15];
      |     ^~~~~
Language: C++

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

int c[15][15];
int cost[15];
bool visit[15];

void dfs(int num, int start, int now=0){
  if(num==1){
    cost[start]=min(cost[start],now);
    return;
  }
  for(int i = 0; i <= 9; i++){
    visit[num]=1;
    if(visit[i]) continue;
    now+=c[num][i];
    dfs(i,start,now);
    now-=c[num][i];
    visit[i]=0;
  }
}

int main(){
  int h,w;
  cin>>h>>w;
  rep(i,10)rep(j,10){
    cin>>c[i][j];
  }
  map<int,int> mp;
  rep(i,h)rep(j,w){
    int a;
    cin>>a;
    if(a!=-1)mp[a]++;
  }
  rep(i,10) cost[i]=c[i][1];
  for(int i = 0; i <= 9; i++){
    if(i==1) continue;
    rep(j,10)visit[j]=0;
    dfs(i,i);
  }
  int ans=0;
  for(auto x : mp){
    ans += cost[x.first] * x.second;
  }
  cout<<ans<<endl;
}



Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:17:5: error: reference to 'visit' is ambiguous
   17 |     visit[num]=1;
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [15]'
    9 | bool visit[15];
      |      ^~~~~
a.cc:18:8: error: reference to 'visit' is ambiguous
   18 |     if(visit[i]) continue;
      |        ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [15]'
    9 | bool visit[15];
      |      ^~~~~
a.cc:22:5: error: reference to 'visit' is ambiguous
   22 |     visit[i]=0;
      |     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [15]'
    9 | bool visit[15];
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:41:14: error: reference to 'visit' is ambiguous
   41 |     rep(j,10)visit[j]=0;
      |              ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [15]'
    9 | bool visit[15];
      |      ^~~~~
Language: C++

H, W = map(int, input().split())
C = []
for _ in range(10):
    C.append(list(map(int, input().split())))

# solve
for k in range(10):
    for i in range(10):
        for j in range(10):
            if C[i][j] > C[i][k] + C[k][j]:
                C[i][j] = C[i][k] + C[k][j]

from collections import Counter
cnt = Counter()
for __ in range(H):
    # A.append(list(map(int, input().split())))
    cnt.update(list(map(int, input().split())))

ans = 0
for i in cnt.keys():
    if i == -1:
        continue
    ans += C[i][1] * cnt[i]

print(ans)

Compiler output:
a.cc:6:3: error: invalid preprocessing directive #solve
    6 | # solve
      |   ^~~~~
a.cc:16:7: error: invalid preprocessing directive #A
   16 |     # A.append(list(map(int, input().split())))
      |       ^
a.cc:1:1: error: 'H' does not name a type
    1 | H, W = map(int, input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
struct edge{ll to, cost;};
typedef pair<ll,ll> P;
struct graph{
  ll V;
  vector<vector<edge> > G;
  vector<ll> d;

  graph(ll n){
    init(n);
  }

  void init(ll n){
    V = n;
    G.resize(V);
    d.resize(V);
    rep(i,V){
      d[i] = INF;
    }
  }

  void add_edge(ll s, ll t, ll cost){
    edge e;
    e.to = t, e.cost = cost;
    G[s].push_back(e);
  }

  void dijkstra(ll s){
    rep(i,V){
      d[i] = INF;
    }
    d[s] = 0;
    priority_queue<P,vector<P>, greater<P> > que;
    que.push(P(0,s));
    while(!que.empty()){
      P p = que.top(); que.pop();
      ll v = p.second;
      if(d[v]<p.first) continue;
      for(auto e : G[v]){
        if(d[e.to]>d[v]+e.cost){
          d[e.to] = d[v]+e.cost;
          que.push(P(d[e.to],e.to));
        }
      }
    }
  }
};
int main(){
ll h,w;
cin>>h>>w;
graph g1(10);
rep(i,10){
rep(j,10){
ll a; cin>>a;
g1.add_edge(i,j,a);
}
}
ll b[10]={};
ll a[h][w]={};
rep(i,h){
rep(j,w){
cin>>a[i][j];
b[a[i][j]]++;}}
ll ca = 0;
rep(i,10){
g1.dijkstra(i);
ca += g1.di[1];
}
cout << ca << endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:96:10: error: 'struct graph' has no member named 'di'; did you mean 'd'?
   96 | ca += g1.di[1];
      |          ^~
      |          d
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
struct edge{ll to, cost;};
typedef pair<ll,ll> P;
struct graph{
  ll V;
  vector<vector<edge> > G;
  vector<ll> d;

  graph(ll n){
    init(n);
  }

  void init(ll n){
    V = n;
    G.resize(V);
    d.resize(V);
    rep(i,V){
      d[i] = INF;
    }
  }

  void add_edge(ll s, ll t, ll cost){
    edge e;
    e.to = t, e.cost = cost;
    G[s].push_back(e);
  }

  void dijkstra(ll s){
    rep(i,V){
      d[i] = INF;
    }
    d[s] = 0;
    priority_queue<P,vector<P>, greater<P> > que;
    que.push(P(0,s));
    while(!que.empty()){
      P p = que.top(); que.pop();
      ll v = p.second;
      if(d[v]<p.first) continue;
      for(auto e : G[v]){
        if(d[e.to]>d[v]+e.cost){
          d[e.to] = d[v]+e.cost;
          que.push(P(d[e.to],e.to));
        }
      }
    }
  }
};
int main(){
ll h,w;
cin>>h>>w;
graph g1(10);
rep(i,10){
rep(j,10){
ll a; cin>>a;
g1.add_edge(i,j,a);
}
}
ll b[10]={};
ll a[h][w]={};
rep(i,h){
rep(j,w){
cin>>a[i][j];
b[a[i][j]]++;}}
ll ca = 0;
rep(i,10){
g1.dijkstra(i);
ca += g1.dist[1];
}
cout << ca << endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:96:10: error: 'struct graph' has no member named 'dist'
   96 | ca += g1.dist[1];
      |          ^~~~
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:20: warning: extra tokens at end of #include directive
    1 | #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);}
      |                    ^
a.cc:1:11: fatal error: cstdio : No such file or directory
    1 | #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);}
      |           ^~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define PRINT(x) cout<<(x)<<endl
#define INF 1000000000000 // 10^12
#define MOD 1000000007 // 10^9+7
#define PB push_back
#define MP make_pair

const int MAX_H = 200, MAX_W = 200;

int H, W;
int c[10][10];
int A[MAX_H][MAX_W];

int main() {
    cin >> H >> W;
    REP(i, 10) {
        REP(j, 10) cin >> c[i][j];
    }
    REP(i, H) {
        REP(j, W) cin >> A[i][j];
    }
    
    REP(k, 10) {
        REP(i, 10) {
            REP(j, 10) c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
        }
    }

    int min_mp = 0;
    REP(i, H) {
        REP(j, W) {
            if (A[i][j] != -1) min_mp += c[A[i][j]][1];
    }
    PRINT(min_mp);
    return 0;
}

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

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

#define ll long long

const int INF = 1000000;

void chmin(int& a, int b){ 
  if (a > b) a = b;
}

int main() {
  int H, W;
  cin >> H >> W;
  
  ll cost[10][10];
  
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      cin >> cost[i][j];
    }
  }
  
  ll dp[11][10][10];
  
  
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      for (int k = 0; k < 10; k++) {
        dp[i][j][k] = INF;
      }
    }
  }
  
  for (int j = 0; j < 10; j++) {
    for (int k = 0; k < 10; k++) {
      dp[1][j][k] = cost[j][k];
    }
  }
  
  for (int i = 1; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      for (int k = 0; k < 10; k++) {
        for (int l = 0; l < 10; l++) {
          chmin(dp[i+1][j][k], dp[i][j][l] + cost[l][k]);
        }
      }
    }
  }
  vector<ll> numcount(10, 0);
  
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      int x;
      cin >> x;      
      if (x != -1) numcount[x]++;
    }
  }
  
  ll ans = 0;
  for (int i = 0; i < 10; i++) {
    ans += numcount[i] * dp[10][i][1];
  }
  
  cout << ans << endl;
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:29: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   45 |           chmin(dp[i+1][j][k], dp[i][j][l] + cost[l][k]);
      |                 ~~~~~~~~~~~~^
a.cc:8:17: note:   initializing argument 1 of 'void chmin(int&, int)'
    8 | void chmin(int& a, int b){
      |            ~~~~~^
Language: C++

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

int main(){
    int h, w; cin >> h >> w;
    ll c[10][10], d[h][w];
    rep(i,10) rep(j,10) cin >> c[i][j];
    rep(i,h) rep(j,w) cin >> d[i][j];

    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(i,h) rep(j,w) {
        if(abs(d[i][j]) == 1) continue;
        ans += c[d[i][j]][1];
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll c[10][10], d[h][w];
      |     ^~
a.cc:8:32: error: 'c' was not declared in this scope
    8 |     rep(i,10) rep(j,10) cin >> c[i][j];
      |                                ^
a.cc:9:30: error: 'd' was not declared in this scope
    9 |     rep(i,h) rep(j,w) cin >> d[i][j];
      |                              ^
a.cc:11:35: error: 'c' was not declared in this scope
   11 |     rep(k,10) rep(i,10) rep(j,10) c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
      |                                   ^
a.cc:16:16: error: 'd' was not declared in this scope
   16 |         if(abs(d[i][j]) == 1) continue;
      |                ^
a.cc:17:16: error: 'c' was not declared in this scope
   17 |         ans += c[d[i][j]][1];
      |                ^
a.cc:17:18: error: 'd' was not declared in this scope
   17 |         ans += c[d[i][j]][1];
      |                  ^
Language: C++

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

int main(){
    int h, w; cin >> h >> w;
    ll c[10][10], d[h][w];
    rep(i,10) rep(j,10) cin >> c[i][j];
    irep(i,h) rep(j,w) cin >> d[i][j];

    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(i,h) rep(j,w) {
        if(abs(d[i][j]) == 1) continue;
        ans += c[d[i][j]][1];
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll c[10][10], d[h][w];
      |     ^~
a.cc:8:32: error: 'c' was not declared in this scope
    8 |     rep(i,10) rep(j,10) cin >> c[i][j];
      |                                ^
a.cc:9:10: error: 'i' was not declared in this scope
    9 |     irep(i,h) rep(j,w) cin >> d[i][j];
      |          ^
a.cc:9:5: error: 'irep' was not declared in this scope; did you mean 'rep'?
    9 |     irep(i,h) rep(j,w) cin >> d[i][j];
      |     ^~~~
      |     rep
a.cc:9:19: error: 'j' was not declared in this scope
    9 |     irep(i,h) rep(j,w) cin >> d[i][j];
      |                   ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i, n) for (int i=0; i<n; i++)
      |                                 ^
a.cc:11:35: error: 'c' was not declared in this scope
   11 |     rep(k,10) rep(i,10) rep(j,10) c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
      |                                   ^
a.cc:16:16: error: 'd' was not declared in this scope
   16 |         if(abs(d[i][j]) == 1) continue;
      |                ^
a.cc:17:16: error: 'c' was not declared in this scope
   17 |         ans += c[d[i][j]][1];
      |                ^
a.cc:17:18: error: 'd' was not declared in this scope
   17 |         ans += c[d[i][j]][1];
      |                  ^
Language: C++

#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.10f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e10;
const ll MAX_N = 1010;

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

ll c[20][20];
ll math[220][220];
ll number[11];
ll dp[20][20];

//long longしか使わない
//素数は1より大きい
int main() {
	ll h, w;
	cin >> h >> w;
	rep(i, 10) {
		rep(j, 10) {
			cin >> c[i][j];
		}
	}
	rep(i, 10) {
		rep(j, 10) {
			if(j==1)continue
			rep(k, 10) {
				if (j == k)continue;
				c[j][k] = min(c[j][k], c[j][i] + c[i][k]);
			}
		}
	}
	ll ans = 0;
	rep(i, h) {
		rep(j, w) {
			cin >> math[i][j];
			if (math[i][j] != 1 && math[i][j] != -1)ans += c[math[i][j]][1];
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:41: error: expected ';' before 'for'
   62 |                         if(j==1)continue
      |                                         ^
      |                                         ;
Language: C++

const ll MOD = 1000000007;
const ll INF = 1LL<<60;
//int INF = numeric_limits<int>::max();

int main(int, char**) {
	int h, w; cin >> h >> w;
	vector<vector<int>> dist(10, vector<int>(10));
	vector<int> mind;
	for (int i=0; i<10; i++) {
		for (int j=0; j<10; j++) {
			int c; cin >> c;
			dist[i][j] = c;
		}
	}
	for (int i=0; i<10; i++) {
		for (int j=0; j<10; j++) {
			for (int k=0; k<10; k++) {
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
			}
		}
	}
	ll ret = 0;
	for (int i=0; i<h*w; i++) {
		int a; cin >> a;
		if (a==-1) continue;
		else ret += dist[a][1];
	}
	cout << ret << endl;
	return 0;
}

Compiler output:
a.cc:1:7: error: 'll' does not name a type
    1 | const ll MOD = 1000000007;
      |       ^~
a.cc:2:7: error: 'll' does not name a type
    2 | const ll INF = 1LL<<60;
      |       ^~
a.cc: In function 'int main(int, char**)':
a.cc:6:19: error: 'cin' was not declared in this scope
    6 |         int h, w; cin >> h >> w;
      |                   ^~~
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<vector<int>> dist(10, vector<int>(10));
      |         ^~~~~~
a.cc:7:23: error: expected primary-expression before 'int'
    7 |         vector<vector<int>> dist(10, vector<int>(10));
      |                       ^~~
a.cc:8:16: error: expected primary-expression before 'int'
    8 |         vector<int> mind;
      |                ^~~
a.cc:12:25: error: 'dist' was not declared in this scope
   12 |                         dist[i][j] = c;
      |                         ^~~~
a.cc:18:33: error: 'dist' was not declared in this scope
   18 |                                 dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
      |                                 ^~~~
a.cc:18:46: error: 'min' was not declared in this scope; did you mean 'main'?
   18 |                                 dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
      |                                              ^~~
      |                                              main
a.cc:22:9: error: 'll' was not declared in this scope
   22 |         ll ret = 0;
      |         ^~
a.cc:26:22: error: 'ret' was not declared in this scope
   26 |                 else ret += dist[a][1];
      |                      ^~~
a.cc:26:29: error: 'dist' was not declared in this scope
   26 |                 else ret += dist[a][1];
      |                             ^~~~
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << ret << endl;
      |         ^~~~
a.cc:28:17: error: 'ret' was not declared in this scope
   28 |         cout << ret << endl;
      |                 ^~~
a.cc:28:24: error: 'endl' was not declared in this scope
   28 |         cout << ret << endl;
      |                        ^~~~
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++

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

using namespace std;
typedef long long int ll;
ll mod=1000000007;
ll power(ll x, ll  y)  {  ll res = 1;x = x % mod;y=y%mod;while (y > 0)  {  if (y & 1)  res = ((res%mod)*(x%mod)) % mod;  
y = y>>1;x = ((x%mod)*(x%mod)) % mod;  }  return res%mod;  }  
// ll l[3000][3000],r[3000][3000],u[3000][3000],d[3000][3000],A[3000][3000];
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 ]);
// shortest path from all to all,,, means from 5 to 4 or 6 to 1 or 7 to all
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: In function 'int main()':
a.cc:2:15: error: 'i' was not declared in this scope
    2 | # define rep (i , n ) for ( int ( i )=0;( i ) <( n );( i )++)
      |               ^
a.cc:15:1: note: in expansion of macro 'rep'
   15 | rep (i ,10) rep (j ,10) scanf ("% d " ,& c [ i ][ j ]);
      | ^~~
a.cc:2:19: error: 'n' was not declared in this scope; did you mean 'yn'?
    2 | # define rep (i , n ) for ( int ( i )=0;( i ) <( n );( i )++)
      |                   ^
a.cc:15:1: note: in expansion of macro 'rep'
   15 | rep (i ,10) rep (j ,10) scanf ("% d " ,& c [ i ][ j ]);
      | ^~~
a.cc:24:9: warning: unknown escape sequence: '\040'
   24 | printf ("% d \ n " , res );
      |         ^~~~~~~~~~
Language: C++

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


int main()
{
    int h,w;
    int sum;
    cin>>h>>w;
  
    int dist[10][10];
    int A[h][w];
    
    for(int i=0;i<10;i++)
    {
      for(int j=0;j<10;j++)
      {
         cin>>dist[i][j];
      }
    }
  
     for(int k=0;k<10;k++)
     {
       for(int i=0;i<10;i++)
       {
         for(int j=0;j<10;j++)
         {
             dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
         }
       }
     }
  

    for(int i=0;i<h;i++)
    {
       for(int j=0;j<w;j++)
       {
          cin>>A[i][w];
       }
    }
  
   for(auto x:A)
   {
     sum+=dist[x][1];   
   }

  cout<<sum<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:15: error: invalid types 'int [10][10][int*]' for array subscript
   44 |      sum+=dist[x][1];
      |               ^
Language: C++

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

ll get_min_dist(ll start, ll goal, const vector<vector<ll>>& cs)
{
    vector<ll> dp(10, 1e9);
    vector<ll> dp_n(10, 1e9);

    dp[start] = 0;
    for (ll i = 0; i < 10; ++i) {
        for (ll j = 0; j < 10; ++j) {
            for (ll k = 0; k < 10; ++k) {
                dp_n[k] = min(dp_n[k], dp[j] + cs[j][k]);
            }
        }
        dp = move(dp_n);
        dp_n.assign(10, 1e9)
    }

    return dp[goal];
}

void main_()
{
    ll H, W;
    cin >> H >> W;
    vector<vector<ll>> cs(10, vector<ll>(10));
    for (auto&& c : cs) {
        copy_n(istream_iterator<ll>(cin), 10, begin(c));
    }
    vector<vector<ll>> As(H);
    for (ll i = 0; i < H; i++) {
        copy_n(istream_iterator<ll>(cin), W, back_inserter(As[i]));
    }

    vector<ll> min_dists_to_1(10);
    for (ll i = 0; i < 10; i++) {
        min_dists_to_1[i] = get_min_dist(i, 1, cs);
    }

    ll ans = 0;
    for (ll i = 0; i < H; i++) {
        ans += accumulate(
            begin(As[i]), end(As[i]),
            0LL, [&min_dists_to_1](auto acc, auto n) {
                return acc + ((n < 0) ? 0 : min_dists_to_1[n]);
            });
    }

    cout << ans << endl;
}
int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    main_();
    return 0;
}


Compiler output:
a.cc: In function 'll get_min_dist(ll, ll, const std::vector<std::vector<long long int> >&)':
a.cc:18:29: error: expected ';' before '}' token
   18 |         dp_n.assign(10, 1e9)
      |                             ^
      |                             ;
   19 |     }
      |     ~
Language: C

#include <stdio.h>

int main(void) {

  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]);
    }
  }
  int a[h][w];
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int n = 1; n <= 10; n++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        for (int k = 0; k < n; k++) {
          if (c[i][k]+c[k][j] < c[i][j]) {
            c[i][j] = c[i][k]+c[k][j];
            flag = 1;
          }
        }
      }
    }
  }
  long magic = 0;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (a[i][j] != -1 && a[i][j] != 1) {
        magic += c[a[i][j]][1];
      }
    }
  }
  printf("%ld\n", magic);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:13: error: 'flag' undeclared (first use in this function)
   25 |             flag = 1;
      |             ^~~~
main.c:25:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void) {

  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]);
    }
  }
  int a[h][w];
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; 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][k]+c[k][j] < c[i][j]) {
          c[i][j] = c[i][k]+c[k][j];
          flag = 1;
        }
      }
    }
  }
  long magic = 0;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if (a[i][j] != -1 && a[i][j] != 1) {
        magic += c[a[i][j]][1];
      }
    }
  }
  printf("%ld\n", magic);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:11: error: 'flag' undeclared (first use in this function)
   24 |           flag = 1;
      |           ^~~~
main.c:24:11: note: each undeclared identifier is reported only once for each function it appears in
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++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int h,w,csum;
    cin >> h >> w;
    int count = 10;
    int64_t c[10][10], A[h][w];

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

    for (size_t i = 0; i < count; i++)
    {
        for (size_t j = 0; j < count; j++)
        {
            for (size_t k = 0; k < count; k++)
            {
                c[i][j] = min(c[i][j],c[i][k] + c[k][j]);
            }
            
        }
        
    }
    
    for (size_t i = 0; i < h; i++)
    {
        for (size_t j = 0; j < w; j++)
        {
            cin >> A[i][j];
            if(A[i][j] > 0){
            csum += c[A[i][j]][1];

            }
        }
    }
    cout << csum << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:42:26: error: expected '}' at end of input
   42 |     cout << csum << endl;
      |                          ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int H, W;
    cin >> H >> W;
    vector<vector<int>> c(10, vector<int>(10)), d(10, vector<int>(10, INT_MAX));
    REP(i, 10) REP(j, 10) { cin >> c[i][j]; }
    d = c;
    REP(i, 10) REP(j, 10) REP(k, 10) {
        d[i][j] = min(d[i][j],d[i][k]+d[k][j])
    }
    int res = 0;
    REP(i, H) REP(j, W) {
        int A;
        cin >> A;
        if (A == -1) continue;
        res += d[A][1];
    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:47: error: expected ';' before '}' token
   15 |         d[i][j] = min(d[i][j],d[i][k]+d[k][j])
      |                                               ^
      |                                               ;
   16 |     }
      |     ~
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:
main.c:1:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  int h,w;
  cin>>h>>w;
  vector<vector<int>>c(10,vector<int>(10));
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++) cin>>c[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];
  }
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      for(int k=0;k<10;k++){
        if(c[j][k]>c[j][i]+c[i][k]) c[j][k]=c[j][i]+c[i][k];
      }
    }
  }
  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][j]];
    }
  }
  cout<<ans<<endl;
}   


Compiler output:
a.cc: In function 'int main()':
a.cc:25:26: error: no match for 'operator+=' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'})
   25 |       if(a[i][j]!=-1) ans+=c[a[i][j]];
Language: Java



import java.util.Scanner;

public class Maiin {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int h = Integer.parseInt(sc.next());
		int w = Integer.parseInt(sc.next());

		int[][] c = new int[10][10];
		int[] a = new int[10];

		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				c[i][j] = Integer.parseInt(sc.next());
			}
		}

		int b;
		for (int i = 0; i < h * w; i++) {
			b = Integer.parseInt(sc.next());
			if (b != -1)
				a[b]++;
		}

		for (int k = 0; k < 10; k++) {
			for (int i = 0; i < 10; i++) {
				for (int j = 0; j < 10; j++) {
					c[i][j] = Math.min(c[i][j], c[i][k] + c[k][j]);
				}
			}
		}

		int ans = 0;
		for (int i = 0; i < 10; i++) {
			ans += a[i] * c[i][1];
		}

		System.out.println(ans);

	}

}


Compiler output:
Main.java:5: error: class Maiin is public, should be declared in a file named Maiin.java
public class Maiin {
       ^
1 error
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
#define int long long
#define double long double
#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())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_back
#define pp() pop_back()
#define V vector
#define P pair
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define Q queue
#define pri priority_queue
#define Pri priority_queue<int,vector<int>,greater<int>>
#define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>>
#define all(a)  (a).begin(),(a).end()


signed main(){
  int a,b;
  cin>>a>>b;
  V<V<int>> c(10,V<int>(10));
  fo(i,10){
    fo(j,10){
      cin>>c[i][j];
    }
  }
  V<V<int>> d(a,V<int>(b));
  fo(i,a){
    fo(j,b){
      cin>>d[i][j];
    }
  }
  fo(k,10){
    fo(i,10){
      fo(j,10){
        c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
      }
    }
  }
  int e=0;
  fo(i,a){
    fo(j,b){
      if(d[i][j]==1)
        continue;

      if(d[i][j]!=-1){
        e+=c[d[i][j]][1];
      }
    }

  }
  cout<<e<<endl;
}
cc

Compiler output:
a.cc:65:1: error: 'cc' does not name a type
   65 | cc
      | ^~
Language: C++

 #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <iomanip>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << endl
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
int dx8[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy8[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dx4[4] = {1, 0, -1, 0};
int dy4[4] = {0, 1, 0, -1};
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

vvi d;
int V,E;
void warshall_floyd(int n) {
for (int i = 0; i < n; i++){
 for (int j = 0; j < n; j++){
 for (int k = 0; k < n; k++) {
if(d[j][i] == INF || d[i][k] == INF) continue;//overflow対策
 d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
 }
}
}
}

int main(void) {
    int H,W;
    cin >> H >> W;
    d.assign(10,vi(10));
    rep(i,10){
        rep(j,10){
            cin >> d[i][j];
        }
    } 
    
    vvi A(H,vi(W));
    rep(i,H){
        rep(j,W){
            cin >> A[i][j];
        }
    }

    warshall_floyd(d);
    
    ll ans=0;
    rep(i,H){
        rep(j,W){
            if(A[i][j] == -1 || A[i][j] == 1) continue;
            ans += d[A[i][j]][1];
        }
    }

    fin(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:89:20: error: cannot convert 'vvi' {aka 'std::vector<std::vector<int> >'} to 'int'
   89 |     warshall_floyd(d);
      |                    ^
      |                    |
      |                    vvi {aka std::vector<std::vector<int> >}
a.cc:61:25: note:   initializing argument 1 of 'void warshall_floyd(int)'
   61 | void warshall_floyd(int n) {
      |                     ~~~~^
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll h,w;
  vvll d(10,vll(10));
  vvll c(h,vll(w));
  rep(i,10)rep(j,10){
    cin>>d[i][j];
  }
  rep(i,h)rep(j,w)cin>>c[i][j];
  rep(i,10)rep(j,10)rep(u,10){
    d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
  }
  ll ans=0;
  rep(i,h)rep(j,w){
    if(c[i][j]==1||c[i][j]==-1) continue;
    ans+=d[c[i][j]][1];
  }
  COUT(ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:30: error: 'k' was not declared in this scope
   51 |     d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
      |                              ^