Submission #717462

# Submission time Handle Problem Language Result Execution time Memory
717462 2023-04-02T00:19:15 Z 1ne Swapping Cities (APIO20_swap) C++14
0 / 100
104 ms 6616 KB
#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;	
	order.resize(N - 1);
	cost.resize(N);
	for (int i = 0;i<n;++i){
		cost[V[i]] = W[i];
	}	
	iota(order.begin(),order.end(),1);
	sort(order.begin(),order.end(),[&](int i,int j){
	   return cost[i] < cost[j];
	});
}

int getMinimumFuelCapacity(int X, int Y) {
   if (n <= 3){
   	return -1;	
   }
   if (X == 0){
   	return max({cost[order[3]],cost[X],cost[Y]});
   }
   else{
 		return max({cost[order[2]],cost[X],cost[Y]});  
   }
}
                               
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 101 ms 6232 KB Output is correct
4 Correct 104 ms 6216 KB Output is correct
5 Correct 87 ms 6616 KB Output is correct
6 Correct 89 ms 6172 KB Output is correct
7 Incorrect 87 ms 6428 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -