답안 #493623

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
493623 2021-12-12T11:59:55 Z Jeff12345121 Brperm (RMI20_brperm) C++14
50 / 100
3000 ms 1404 KB
#include <bits/stdc++.h>
#include "brperm.h"
using namespace std;


const int nmax = 500005;
int n;
char c[nmax];
void init(int N, const char C[]) {
    n = N;
    for (int i = 0; i < N; i++) {
        c[i] = C[i];
    }
}
int rev(int x, int k) {
    int res = 0,cnt = 0;
    for (int i = k - 1; i >= 0; i--) {
        if (x & (1 << i)) res += (1 << cnt);
        cnt++;
    }
    return res;
}
int query(int i, int k) {
    if (i + (1 << k) - 1 >= n) return 0;
    int limit = i + (1 << k) - 1;
    for (int j = i; j <= limit; j++) {
        if (c[j] != c[rev(j - i , k) + i]) return 0;
    }
    return 1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 27 ms 716 KB Output is correct
4 Correct 26 ms 620 KB Output is correct
5 Correct 25 ms 640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3028 ms 1404 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 27 ms 716 KB Output is correct
4 Correct 26 ms 620 KB Output is correct
5 Correct 25 ms 640 KB Output is correct
6 Execution timed out 3028 ms 1404 KB Time limit exceeded
7 Halted 0 ms 0 KB -