Submission #588973

# Submission time Handle Problem Language Result Execution time Memory
588973 2022-07-04T08:22:49 Z Arnch The Potion of Great Power (CEOI20_potion) C++17
0 / 100
50 ms 8540 KB
#include<bits/stdc++.h>
using namespace std;

const int N = 1e3 + 10, maxn = 1e6 + 10;

int n, d, h[maxn], a[maxn], b[maxn];
set<int> st[N];

void init(int N, int D, int H[]) {
	n = N, d = D;
	for(int i = 0; i < n; i++) h[i] = H[i];
}

void curseChanges(int U, int A[], int B[]) {
	for(int i = 0; i < U; i++) {
		a[i] = A[i], b[i] = B[i];
	}

	for(int i = 0; i < U; i++) {
		if(st[a[i]].count(b[i]) != 0) st[a[i]].erase(b[i]);
		else st[a[i]].insert(b[i]);

		if(st[b[i]].count(a[i]) != 0) st[b[i]].erase(a[i]);
		else st[b[i]].insert(a[i]);
	}
}

int question(int x, int y, int v) {
	int ans = 1e9;
	for(auto it : st[x]) {
		for(auto it2 : st[y]) {
			ans = min(ans, abs(h[it] - h[it2]));
		}
	}

	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 336 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 50 ms 8540 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 48 ms 8480 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 976 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 336 KB Incorrect
2 Halted 0 ms 0 KB -