Submission #375314

# Submission time Handle Problem Language Result Execution time Memory
375314 2021-03-09T07:21:40 Z astoria Swapping Cities (APIO20_swap) C++14
0 / 100
1 ms 492 KB
#include "bits/stdc++.h"
#include "swap.h"
using namespace std;

const int NN=100005;
int len[NN];
multiset<int> s;

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 v = V[i];
		len[v] = W[i];
		s.insert(len[v]);
	}
}

int getMinimumFuelCapacity(int X, int Y) {
	int mx = max(len[X],len[Y]);
	s.erase(s.find(len[X]));
	s.erase(s.find(len[Y]));
	if(s.empty()) return -1;
	mx=max(mx, *s.begin());
	s.insert(len[X]); s.insert(len[Y]);
	return mx;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -