#include "dreaming.h"
#include<bits/stdc++.h>
using namespace std ;
const int NN = 1e5 + 5 ;
vector<pair<int , int > > adj[NN];
int sum = 0 ;
int vis[NN];
void dfs(int u){
vis[u]++;
for(auto f : adj[u]){
if(vis[f.first])continue ;
sum += f.second ;
dfs(f.first);
}
}
int travelTime(int N, int M, int L, int A[], int B[], int T[]) {
for(int i = 0 ; i < M ; i ++){
adj[A[i]].push_back({B[i] , T[i]});
adj[B[i]].push_back({A[i] , T[i]});
}
for(int i = 0 ; i < N ; i ++)
if(!vis[i])dfs(i);
sum += L ;
return sum ;
return 42;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
50 ms |
9720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
50 ms |
9720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
50 ms |
9720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
23 ms |
5760 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
50 ms |
9720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
50 ms |
9720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |