92462024-02-19 11:17:07TuruTamasHálózati átvitelcsharpForditási hiba
#include <bits/stdc++.h>
using namespace std;

#ifdef DEBUG
ifstream in_file("minta/be2.txt");
#define input in_file
#define INTHENAMEOFGOD
#else
#define input cin
#define INTHENAMEOFGOD \
    ios::sync_with_stdio(0); \
    cin.tie(0); \
    cout.tie(0);
#endif
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<ll, ll> pii;

ll N, M, H, K, a, b, c;
vector<vector<pii>> G;
vi s;
vector<pii> vp;

void dfs(ll x, ll h, ll seb) {
    s[x] = max(s[x], seb);
    if (h == H) {
        return;
    }
    for (pii &next : G[x]) {
        auto &p = vp[next.first];
        if (p.first < h+1 && p.second > min(seb, next.second)) {
            continue;
        } else if (p.first >= h+1 &&  p.second <= min(seb, next.second)) {
            p = {h+1, min(seb, next.second)};
        }
        dfs(next.first, h+1, min(seb, next.second));
    }
}

int main() {
    INTHENAMEOFGOD
    input >> N >> M >> K >> H;
    K--;
    G.resize(N);
    s.assign(N, -1);
    vp.assign(N, {LLONG_MAX, 0});
    
    for (ll m = 0; m < M; m++) {
        input >> a >> b >> c;
        a--; b--;
        G[a].emplace_back(b, c);
        G[b].emplace_back(a, c);
    }

    dfs(K, 0, LLONG_MAX);
    s[K] = 0;

    for (ll val : s) {
        cout << val << "\n";
    }
}
Forditási hiba
exit status 1
main.cs(2,0): error CS1024: Wrong preprocess