#include "swap.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int n,m,maxxy = 0;
vector<int>order;
vector<int>cost;
void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
n = N;
m = M;
cost.resize(N);
for (int i = 0;i<n;++i){
cost[V[i]] = W[i];
}
order = W;
sort(order.begin(),order.end());
}
int getMinimumFuelCapacity(int X, int Y) {
if (n <= 3){
return -1;
}
if (X == 0){
return max({order[2],cost[X],cost[Y]});
}
else{
return max({order[2],cost[X],cost[Y]});
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
84 ms |
6256 KB |
Output is correct |
4 |
Correct |
82 ms |
6196 KB |
Output is correct |
5 |
Correct |
84 ms |
6436 KB |
Output is correct |
6 |
Correct |
84 ms |
6196 KB |
Output is correct |
7 |
Correct |
82 ms |
6392 KB |
Output is correct |
8 |
Correct |
82 ms |
10140 KB |
Output is correct |
9 |
Correct |
90 ms |
10128 KB |
Output is correct |
10 |
Correct |
100 ms |
10120 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |