Submission #136533

#TimeUsernameProblemLanguageResultExecution timeMemory
136533miguelCrocodile's Underground City (IOI11_crocodile)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include<crocodile.h> using namespace std; #define pb push_back #define dbg(x) cout << #x << '=' << x << '\n'; #define ll long long #define x first #define y second #define pi pair <int, int> #define pii pair <int, pi> #define vi vector <int> const ll mod = 998244353; vector <pi> g[10001]; int t[10001]; void dfs(int nod, int p){ for(pi i: g[nod]){ if(i.x!=p) dfs(i.x, nod); } vi v; if(t[i]==1000000001){ for(pi i: g[nod]){ if(i.x!=p) v.pb(t[i.x]+i.y); } sort(v.begin(), v.end()); t[nod]=v[1]; } } int travel_plan(int n, int m, int r[][2], int l[], int k, int p[]){ for(int i=0; i<n; i++) t[i]=1000000001; for(int i=0; i<k; i++) t[p[i]]=0; for(int i=0; i<m; i++){ g[r[i][0]].pb({r[i][1], l[i]}); g[r[i][1]].pb({r[i][0], l[i]}); } dfs(0, -1); return t[0]; }

Compilation message (stderr)

crocodile.cpp: In function 'void dfs(int, int)':
crocodile.cpp:21:10: error: 'i' was not declared in this scope
     if(t[i]==1000000001){
          ^