#include <bits/stdc++.h>
using namespace std;
map<int,set<int>> adj;
multiset<int> ms;
map<pair<int,int>,int> edwt;
int SUBTASK1=0;
bool isCyc=0;
bool isSubtask1=true;
bool isCycle(){
for(auto x:adj){
if(x.second.size()<=1)return false;
if(x.second.size()>2)isSubtask1=false;
}
return true;
}
void init(int N, int M,std::vector<int> U, std::vector<int> V, std::vector<int> W) {
for(int i=0;i<M;i++){
int x=U[i];
int y=V[i];
int z=W[i];
ms.insert(z);
edwt[{min(x,y),max(x,y)}]=z;
SUBTASK1=max(SUBTASK1,(W[i]));
adj[x].insert(y);
adj[y].insert(x);
}
isCyc=isCycle();
}
int getMinimumFuelCapacity(int X, int Y) {
if(isSubtask1){
if(isCyc){
return SUBTASK1;
}else
return -1;
}else{
return -1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
492 KB |
Output is correct |
5 |
Correct |
2 ms |
640 KB |
Output is correct |
6 |
Correct |
2 ms |
620 KB |
Output is correct |
7 |
Correct |
2 ms |
620 KB |
Output is correct |
8 |
Correct |
2 ms |
620 KB |
Output is correct |
9 |
Correct |
300 ms |
27116 KB |
Output is correct |
10 |
Correct |
379 ms |
33132 KB |
Output is correct |
11 |
Correct |
368 ms |
32620 KB |
Output is correct |
12 |
Correct |
429 ms |
34668 KB |
Output is correct |
13 |
Correct |
404 ms |
34668 KB |
Output is correct |
14 |
Correct |
300 ms |
27500 KB |
Output is correct |
15 |
Correct |
459 ms |
37624 KB |
Output is correct |
16 |
Correct |
436 ms |
36652 KB |
Output is correct |
17 |
Correct |
478 ms |
38612 KB |
Output is correct |
18 |
Correct |
457 ms |
38884 KB |
Output is correct |
19 |
Correct |
105 ms |
10860 KB |
Output is correct |
20 |
Correct |
478 ms |
38764 KB |
Output is correct |
21 |
Correct |
467 ms |
37924 KB |
Output is correct |
22 |
Correct |
489 ms |
40016 KB |
Output is correct |
23 |
Correct |
488 ms |
40272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Incorrect |
371 ms |
40508 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
492 KB |
Output is correct |
5 |
Correct |
2 ms |
640 KB |
Output is correct |
6 |
Correct |
2 ms |
620 KB |
Output is correct |
7 |
Correct |
2 ms |
620 KB |
Output is correct |
8 |
Correct |
2 ms |
620 KB |
Output is correct |
9 |
Correct |
300 ms |
27116 KB |
Output is correct |
10 |
Correct |
379 ms |
33132 KB |
Output is correct |
11 |
Correct |
368 ms |
32620 KB |
Output is correct |
12 |
Correct |
429 ms |
34668 KB |
Output is correct |
13 |
Correct |
404 ms |
34668 KB |
Output is correct |
14 |
Correct |
300 ms |
27500 KB |
Output is correct |
15 |
Correct |
459 ms |
37624 KB |
Output is correct |
16 |
Correct |
436 ms |
36652 KB |
Output is correct |
17 |
Correct |
478 ms |
38612 KB |
Output is correct |
18 |
Correct |
457 ms |
38884 KB |
Output is correct |
19 |
Incorrect |
371 ms |
40508 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |