Submission #827244

# Submission time Handle Problem Language Result Execution time Memory
827244 2023-08-16T10:05:39 Z rainboy Brperm (RMI20_brperm) C
0 / 100
3 ms 2260 KB
#include "brperm.h"
#include <stdlib.h>
#include <assert.h>

#define N	500000

char cc[N + 1]; int n;

void init(int n_, const char *cc_) {
	int i;

	n = n_;
	for (i = 0; i < n; i++)
		cc[i] = cc_[i];
}

int query(int i_, int k) {
	int n_, m, i, j;

	n_ = 1 << k;
	if (i_ + n_ > n)
		assert(0);
	for (i = 0, j = 1; j < n_; j++) {
		for (m = n_ >> 1; ((i ^= m) & m) == 0; m >>= 1)
			;
		if (cc[i_ + i] != cc[i_ + j])
			return 0;
	}
	return 1;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 2260 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -