Problem railway
User benji9736
Submission Time 2025-12-17 14:41:18
Score 0
Max Time N/A
Max Memory N/A

Compile Error

railway.cpp: In function ‘void dfs(long long int, long long int, long long int)’:
railway.cpp:10:9: error: request for member ‘first’ in ‘i’, which is of non-class type ‘long long int’
10 | if (i.first != p){
| ^~~~~
railway.cpp:11:10: error: request for member ‘first’ in ‘i’, which is of non-class type ‘long long int’
11 | dfs(i.first, n, d + i.second);
| ^~~~~
railway.cpp:11:26: error: request for member ‘second’ in ‘i’, which is of non-class type ‘long long int’
11 | dfs(i.first, n, d + i.second);
| ^~~~~~
railway.cpp: In function ‘int main()’:
railway.cpp:47:8: error: ‘c’ was not declared in this scope
47 | cin>>c;
| ^
railway.cpp:48:26: error: no matching function for call to ‘std::vector<long long int>::push_back(<brace-enclosed initializer list>)’
48 | adj[a].push_back({b, c});
| ^