Submission #596657

# Submission time Handle Problem Language Result Execution time Memory
596657 2022-07-14T23:53:36 Z pedroslrey Brperm (RMI20_brperm) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "brperm.h"

using namespace std;

const int MAXN = 1010;

char s[MAXN];
int n;

void init(int nn, const char ss[]) {
	n = nn;
	for (int i = 0; i < n; ++i)
		s[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 (s[x + mask] != s[x + rev]) return 0;
	}
	return 1;
}

Compilation message

/usr/bin/ld: /tmp/ccLy1WGj.o:(.bss+0x0): multiple definition of `s'; /tmp/ccsRJ9tn.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status