Submission #588928

# Submission time Handle Problem Language Result Execution time Memory
588928 2022-07-04T07:48:08 Z Arnch The Potion of Great Power (CEOI20_potion) C++17
0 / 100
30 ms 1232 KB
#include<bits/stdc++.h>
using namespace std;

const int N = 1e3 + 10;

int n, d, h[N], a[N], b[N];
bool mark[N][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];
}

int question(int x, int y, int v) {
	memset(mark, 0, sizeof(mark));
	for(int i = 0; i < v; i++) {
		mark[a[i]][b[i]] = 1 - mark[a[i]][b[i]];
		mark[b[i]][a[i]] = 1 - mark[b[i]][a[i]];
	}
	int ans = 1e9;
	for(int i = 0; i < n; i++) {
		if(!mark[x][i]) continue;
		for(int j = 0; j < n; j++) {
			if(!mark[y][j]) continue;
			ans = min(ans, abs(h[i] - h[j]));
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 29 ms 1232 KB Output is correct
2 Correct 30 ms 1232 KB Output is correct
3 Correct 29 ms 1232 KB Output is correct
4 Runtime error 12 ms 1176 KB Execution killed with signal 11
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 13 ms 1224 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 9 ms 1168 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 464 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1232 KB Output is correct
2 Correct 29 ms 1232 KB Output is correct
3 Correct 30 ms 1232 KB Output is correct
4 Correct 29 ms 1232 KB Output is correct
5 Runtime error 12 ms 1176 KB Execution killed with signal 11
6 Halted 0 ms 0 KB -