Submission #596659

# Submission time Handle Problem Language Result Execution time Memory
596659 2022-07-15T00:02:04 Z pedroslrey Brperm (RMI20_brperm) C++14
50 / 100
27 ms 1608 KB
#include <bits/stdc++.h>
#include "brperm.h"

using namespace std;

const int MAXN = 1010;

char str[MAXN];

void init(int n, const char ss[]) {
	for (int i = 0; i < n; ++i)
		str[i] = ss[i];
}

int query(int x, int k) {
	for (int mask = 0; mask < (1 << k); ++mask) {
		int rev = 0;
		for (int i = 0; i < k; ++i)
			if (mask & (1 << i)) rev |= 1 << (k - 1 - i);

		if (str[x + mask] != str[x + rev]) return 0;
	}
	return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 27 ms 1508 KB Output is correct
4 Correct 27 ms 1608 KB Output is correct
5 Correct 27 ms 1472 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1364 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 27 ms 1508 KB Output is correct
4 Correct 27 ms 1608 KB Output is correct
5 Correct 27 ms 1472 KB Output is correct
6 Runtime error 2 ms 1364 KB Execution killed with signal 11
7 Halted 0 ms 0 KB -