제출 #1199350

#제출 시각아이디문제언어결과실행 시간메모리
1199350Valters07Race (IOI11_race)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "race.h"
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
#define fio ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define ld long double
#define en exit(0);
#define pb push_back
#define fi first
#define se second
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 1005;
vector<pair<int,int> > g[N];
int dist[N], len[N];
void dfs(int u, int p)
{
    for(auto [v, w] : g[u])
    {
        if(v != p)
        {
            dist[v] = dist[u] + w;
            len[v] = len[u] + 1;
            dfs(v, u);
        }
    }
}
int best_path(int N, int K, int H[][2], int L[])
{
    for(int i = 0;i < N - 1;i++)
    {
        int u = H[i][0], v = H[i][1], w = L[i];
        g[u].pb({v, w});
        g[v].pb({u, w});s
    }
    int res = -1;
    for(int i = 0;i < N;i++)
    {
        dist[i] = len[i] = 0;
        dfs(i, i);
        for(int j = 0;j < N;j++)
            if(dist[j] == K && (res == -1 || len[j] < res))
                res = len[j];
    }
    return res;
}

컴파일 시 표준 에러 (stderr) 메시지

race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:35:25: error: 's' was not declared in this scope
   35 |         g[v].pb({u, w});s
      |                         ^