Submission #747415

# Submission time Handle Problem Language Result Execution time Memory
747415 2023-05-24T07:15:16 Z vjudge1 Swapping Cities (APIO20_swap) C++17
0 / 100
1 ms 304 KB
#include "swap.h"

#include <bits/stdc++.h>

using namespace std;

vector<int> w1, w2;

void init(int N, int M,
    std::vector<int> U, std::vector<int> V, std::vector<int> W) {
    w1.resize(N);
    w1[0] = 0;
    for(int i = 0; i < N; i++){
        w1[V[i]] = W[i];
    }
    w2 = W;
    sort(w2.begin(), w2.end());
}

int getMinimumFuelCapacity(int X, int Y) {
    int mx = 0;
    if(X != 0) mx = max(mx, w1[X]);
    if(Y != 0) mx = max(mx, w1[Y]);
    int i = 0;
    if(w1[X] == w2[i] || w1[Y] == w2[i])i++;
    if(w1[X] == w2[i] || w1[Y] == w2[i])i++;
    return max(mx, w2[i]);
}

/*

3 2
0 1 5
0 2 5
1
1 2


*/
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -