Submission #596720

# Submission time Handle Problem Language Result Execution time Memory
596720 2022-07-15T02:08:15 Z definitelynotmee Brperm (RMI20_brperm) C++17
0 / 100
2 ms 2388 KB
#include "brperm.h"
#include<bits/stdc++.h>
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
using matrix = vector<vector<T>>;
const ll INFL = 1ll<<60;
const int MOD = 1e9+7;

string s;

void init(int n, const char S[]) {

    s = string(S,S+n);
    return;
}

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

int query(int start, int k) {

    bool wrong = 0;

    for(int i = start; i < start+(1<<k); i++){
        //cout << k << ": " <<  bitset<4>(i-start) << ' ' << bitset<4>(getreverse(i-start,k)) << '\n';
        wrong|=s[getreverse(i-start,k)+start] != s[i];
    }

    return wrong^1;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 2388 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -