Submission #519597

# Submission time Handle Problem Language Result Execution time Memory
519597 2022-01-26T18:55:15 Z Stickfish Brperm (RMI20_brperm) C++17
0 / 100
3000 ms 5852 KB
#include "brperm.h"
#include <cassert>
#include <string>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

const int MAXN = 500008;
int N;
string s;

void init(int n, const char s_[]) {
    N = n;
    for (int i = 0; i < n; ++i)
        s.push_back(s_[i]);
    return;
    //ll raymoo = 1;
    //for (int i = 0; i < n; ++i) {
        //phash[i] = (phash[i - 1] + raymoo * (s[i] - 'a')) % MOD;
        //raymoo = (raymoo * MUL) % MOD;
        //cout << phash[i] << ' ';
    //}
    //cout << endl;
    //return;
}

int query(int l, int k) {
    if (k < 0)
        exit(177013);
    assert(l + k <= N);
    vector<int> ps = {0};
    for (int t = 0; t < k; ++t) {
        for (int i = 0; i < (1 << t); ++i)
            ps.push_back(ps[i] + (1 << (k - t - 1)));
    }
    for (int i = 0; i < (1 << k); ++i) {
        if (s[l + i] != s[l + ps[i]])
            return 0;
    }
    return 1;
}
# Verdict Execution time Memory Grader output
1 Runtime error 9 ms 4928 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 9 ms 4928 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3076 ms 5852 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 9 ms 4928 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -