Submission #755106

# Submission time Handle Problem Language Result Execution time Memory
755106 2023-06-09T12:06:41 Z Stickfish Brperm (RMI20_brperm) C++17
0 / 100
190 ms 4512 KB
#include "brperm.h"
#include <iostream>
#include <string>
#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[]) {
    s = "";
    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 190 ms 4512 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 -