Submission #405980

# Submission time Handle Problem Language Result Execution time Memory
405980 2021-05-17T06:04:01 Z Maqsut_03 Swapping Cities (APIO20_swap) C++17
0 / 100
84 ms 9672 KB
#include "swap.h"
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<deque>

#define ll int
#define pl pair<ll, ll> 
#define llv vector<ll>
#define pb push_back
#define ppb(x, y) push_back({x, y})
#define pv vector<pl>
#define sz size()
#define ss second
#define ff first

using namespace std;
const int N = 2 * 1e5 + 3;

bool f = 0;
pv v;
int a[N], b;

void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) 
{
	if (N > 3) f = 1;
	for (int i=0; i<M; i++) v.ppb(W[i], V[i]);
	sort(v.begin(), v.end());
	b = v[1].ff;
	for (int i=0; i<M; i++) a[W[i]] = V[i];
	return ;
}

int getMinimumFuelCapacity(int X, int Y) 
{
	if (f)
	    return max({b, a[X], a[Y]});
	return -1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Runtime error 1 ms 460 KB Execution killed with signal 11
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Runtime error 84 ms 9672 KB Execution killed with signal 11
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Runtime error 1 ms 460 KB Execution killed with signal 11
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Runtime error 1 ms 460 KB Execution killed with signal 11
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Runtime error 1 ms 460 KB Execution killed with signal 11
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Runtime error 1 ms 460 KB Execution killed with signal 11
5 Halted 0 ms 0 KB -