Submission #596505

# Submission time Handle Problem Language Result Execution time Memory
596505 2022-07-14T19:26:35 Z Hacv16 Brperm (RMI20_brperm) C++17
0 / 100
14 ms 14548 KB
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> pii;
 
const int MAX = 100010;
const int LOG = 18;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
 
#define pb push_back
#define sz(x) (int) x.size()
#define fr first
#define sc second
#define mp make_pair
#define all(x) x.begin(), x.end()
#define dbg(x) cout << #x << ": " << "[ " << x << " ]\n"
 
string s, ans[MAX][2];
 
void init(int n, const char S[]){
    for(int i = 0; i < n; i++)
        s += S[i], ans[i][0] = S[i];
 
    for(int j = 1; j < LOG; j++){
        for(int i = 0; i + (1 << j) <= n; i++){
            ans[i][j] = "";
            for(int k = 0; k < sz(ans[i][j - 1]); k++){
                ans[i][j] += ans[i][!(j % 2)][k];
                ans[i][j] += ans[i + (1 << (j - 1))][!(j % 2)][k];
            }
        }
    }
}
 
int query(int I, int K){
    string aux = s.substr(I, (1 << K));
    return aux == ans[I][K];
}
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 7508 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 7508 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 14 ms 14548 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 7508 KB Output isn't correct
2 Halted 0 ms 0 KB -