Submission #857251

# Submission time Handle Problem Language Result Execution time Memory
857251 2023-10-05T16:37:39 Z divad Brperm (RMI20_brperm) C++14
0 / 100
10 ms 3584 KB
#include <bits/stdc++.h>
#include "brperm.h"
using namespace std;
string str;
 
void init(int n, const char s[]) {
  str = s;
}
 
int rev_bits(int x, int k){
    int ans = 0;
    for(int i = 0; i < k; i++){
        int bt = (x>>i)&1;
        ans += bt*(1<<(k-i-1));
    }
    return ans;
}
 
int query(int pos, int k){
    int len = (1<<k);
    string sub = str.substr(pos, len);
    for(int i = 0; i < len; i++){
        if(sub[i] != sub[rev_bits(i, k)]){
            return false;
        }
    }
    return true;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 10 ms 3584 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -