#include "swap.h"
#include <vector>
using namespace std;
int res = 0;
vector<int> wt(100000);
int m1 = 2000000000, m2 = 2000000000, m3 = 2000000000;
int n;
void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) {
n = N;
for(int i = 0; i < M; i++)
{
wt[V[i]] = W[i];
if(W[i] < m1)
{
m3 = m2;
m2 = m1;
m1 = W[i];
}
else if(W[i] < m2)
{
m3 = m2;
m2 = W[i];
}
else if(W[i] < m3)
{
m3 = W[i];
}
}
}
int getMinimumFuelCapacity(int X, int Y) {
if(X == 0 || Y == 0 || n == 3) return -1;
return max(wt[X], max(wt[Y], m3));
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
748 KB |
Output is correct |
2 |
Correct |
1 ms |
748 KB |
Output is correct |
3 |
Correct |
1 ms |
748 KB |
Output is correct |
4 |
Incorrect |
1 ms |
748 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
748 KB |
Output is correct |
2 |
Correct |
1 ms |
748 KB |
Output is correct |
3 |
Incorrect |
100 ms |
9484 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
748 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
748 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
748 KB |
Output is correct |
2 |
Correct |
1 ms |
748 KB |
Output is correct |
3 |
Correct |
1 ms |
748 KB |
Output is correct |
4 |
Incorrect |
1 ms |
748 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
748 KB |
Output isn't correct |