Submission #398717

# Submission time Handle Problem Language Result Execution time Memory
398717 2021-05-04T18:41:35 Z MilosMilutinovic Brperm (RMI20_brperm) C++14
Compilation error
0 ms 0 KB
/**
 *    author:  milos
 *    created: 04.05.2021 20:27:22       
**/
#include <bits/stdc++.h>
#include "bperm.h"

using namespace std;
 
string s = "";

void init(int n, char seq[]) {
  for (int i = 0; i < n; i++) {
    s += seq[i];
  }  
}

int Rev(int x, int k) {
  int ret = 0;
  for (int i = 0; i < k; i++) {
    if (x & (1 << i)) {
      ret += (1 << (k - i - 1));  
    }
  }
  return ret;
}

int query(int i, int k) {
  if (i + (1 << k) > s.size()) {
    return 0;
  }
  for (int j = i; j < i + (1 << k); j++) {
    if (s[i] != s[i + Rev(j - i, k)]) {
      return 0;  
    }
  }
  return 1;
}

Compilation message

brperm.cpp:6:10: fatal error: bperm.h: No such file or directory
    6 | #include "bperm.h"
      |          ^~~~~~~~~
compilation terminated.