Submission #963210

# Submission time Handle Problem Language Result Execution time Memory
963210 2024-04-14T17:56:42 Z SuPythony Swapping Cities (APIO20_swap) C++17
0 / 100
74 ms 15948 KB
#include "swap.h"
#include <bits/stdc++.h>
using namespace  std;

vector<vector<pair<int,int>>> al;
int mn=1e9;
int n,m;
vector<int> ew;

void init(int N, int M,
          vector<int> U, vector<int> V, vector<int> W) {
    al.assign(N+1,vector<pair<int,int>>());
    ew.assign(N+1,0);
    for (int i=0; i<M; i++) {
        al[U[i]].push_back({V[i],W[i]});
        al[V[i]].push_back({U[i],W[i]});
        ew[V[i]]=W[i];
        mn=min(mn,W[i]);
    }
    n=N;
    m=M;
}

int getMinimumFuelCapacity(int X, int Y) {
    if (m<=2) return -1;
    return max({mn,ew[X],ew[Y]});
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 68 ms 11884 KB Output is correct
4 Incorrect 74 ms 15948 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -