Language: C++

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

using ll=long long;
const int inf=100000001;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

struct road{
    int a,b,c;
}

void dp(pair *t,int n,road abc,int m,int p,int l){
    for (int i=0;i<m;i++){
        if (p==abc[i].a){
            if (t[abc[i].b].first>t[p].first){
                if (abc[i].c<=t[p].second){
                    t[abc[i].b].first=t[p].first;
                    t[abc[i].b].second=t[p].second-abc[i].c;
                    dp(t,n,abc,m,abc[i].b,l);
                }
                else if(abc[]){
                    t[abc[i].b].first=t[p].first+1;
                    
                }
            }
            else if (t[abc[i].b].first=t[p].first){
                
            }
        }
    }
    return 0;
}

main(){
    int n=in(),m=in()*2,l=in();
    road abc[m];
    for (int i=0;i<m/2;i+=2) {
        cin >> a >> b >> c;
        if (c>l) {
            m-=2;
            continue;
        } 
        abc[i].a=a;
        abc[i].b=b;
        abc[i].c=c;
        abc[i+1].a=abc[i].b;
        abc[i+1].b=abc[i].a;
        abc[i+1].c=abc[i].c;
    }
    int q=in();
    for (int quest=0;quest<q;quest++){
        int s=in(),t=in()
        pair t[n];
        for (int i=0;i<n;i++) {
            t[i].first=inf;
            t[i].second=0;
        }
        t[s].first=0;
        t[s].second=l;
        dp(t,n,abc,m,s,l);
        
        
    }
}

Compiler output:
a.cc:51:2: error: expected ';' after struct definition
   51 | }
      |  ^
      |  ;
a.cc:53:9: error: missing template argument list after 'std::pair'; template placeholder not permitted in parameter
   53 | void dp(pair *t,int n,road abc,int m,int p,int l){
      |         ^~~~
      |             <>
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: 'template<class _T1, class _T2> struct std::pair' declared here
   89 |     struct pair;
      |            ^~~~
a.cc: In function 'void dp(...)':
a.cc:55:19: error: no match for 'operator[]' (operand types are 'road' and 'int')
   55 |         if (p==abc[i].a){
      |                   ^
a.cc:56:17: error: 't' was not declared in this scope
   56 |             if (t[abc[i].b].first>t[p].first){
      |                 ^
a.cc:56:22: error: no match for 'operator[]' (operand types are 'road' and 'int')
   56 |             if (t[abc[i].b].first>t[p].first){
      |                      ^
a.cc:57:24: error: no match for 'operator[]' (operand types are 'road' and 'int')
   57 |                 if (abc[i].c<=t[p].second){
      |                        ^
a.cc:58:26: error: no match for 'operator[]' (operand types are 'road' and 'int')
   58 |                     t[abc[i].b].first=t[p].first;
      |                          ^
a.cc:59:26: error: no match for 'operator[]' (operand types are 'road' and 'int')
   59 |                     t[abc[i].b].second=t[p].second-abc[i].c;
      |                          ^
a.cc:59:55: error: no match for 'operator[]' (operand types are 'road' and 'int')
   59 |                     t[abc[i].b].second=t[p].second-abc[i].c;
      |                                                       ^
a.cc:60:37: error: no match for 'operator[]' (operand types are 'road' and 'int')
   60 |                     dp(t,n,abc,m,abc[i].b,l);
      |                                     ^
a.cc:62:29: error: expected primary-expression before ']' token
   62 |                 else if(abc[]){
      |                             ^
a.cc:63:26: error: no match for 'operator[]' (operand types are 'road' and 'int')
   63 |                     t[abc[i].b].first=t[p].first+1;
      |                          ^
a.cc:67:27: error: no match for 'operator[]' (operand types are 'road' and 'int')
   67 |             else if (t[abc[i].b].first=t[p].first){
      |                           ^
a.cc:72:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   72 |     return 0;
      |            ^
a.cc: At global scope:
a.cc:75:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   75 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:79:16: error: 'a' was not declared in this scope
   79 |         cin >> a >> b >> c;
      |                ^
a.cc:79:21: error: 'b' was not declared in this scope
   79 |         cin >> a >> b >> c;
      |                     ^
a.cc:79:26: error: 'c' was not declared in this scope
   79 |         cin >> a >> b >> c;
      |                          ^
a.cc:94:9: error: expected ',' or ';' before 'pair'
   94 |         pair t[n];
      |         ^~~~
a.cc:96:14: error: invalid types 'int[int]' for array subscript
   96 |             t[i].first=inf;
      |              ^
a.cc:97:14: error: invalid types 'int[int]' for array subscript
   97 |             t[i].second=0;
      |              ^
a.cc:99:10: error: invalid types 'int[int]' for array subscript
   99 |         t[s].first=0;
      |          ^
a.cc:100:10: error: invalid types 'int[int]' for array subscript
  100 |         t[s].second=l;
      |          ^