Submission #755105

# Submission time Handle Problem Language Result Execution time Memory
755105 2023-06-09T12:05:39 Z Stickfish Brperm (RMI20_brperm) C++17
0 / 100
211 ms 5256 KB
#include "brperm.h"
#include <iostream>
#include <vector>
using namespace std;

int rvs_pos(int i, int k) {
    int ans = 0;
    for (int bt = 0; bt < k; ++bt) if (i & (1 << bt)) {
        ans += 1 << (k - bt - 1);
    }
    return ans;
}

string s;

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

int query(int l, int k) {
    vector<char> a(1 << k);
    vector<char> b(1 << k);
    for (int i = 0; i < (1 << k); ++i) {
        a[i] = b[rvs_pos(i, k)] = s[l + i];
        //cout << rvs_pos(i, k) << "(" << s[l + i] << ' ' << s[l + rvs_pos(i, k)] << ") ";
        //if (s[l + i] != s[l + rvs_pos(i, k)]) {
            //return 0;
        //}
    }
    //cout << endl;
    return a == b;

}
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 1492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 1492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 211 ms 5256 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 1492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -