답안 #642741

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
642741 2022-09-20T12:35:54 Z TimDee Brperm (RMI20_brperm) C++17
50 / 100
3000 ms 1648 KB
#include "brperm.h"
#include <bits/stdc++.h>
using namespace std;

char S[(int)1e5+10];
int n;
void init(int N, const char s[]) {
    n=N;
    for (int i=0; i<n; ++i) S[i]=s[i];
}

int rev(int x, int k) {
    int ret=0;
    for (int b=k-1; b>=0; --b) {
        ret+=((x>>b)&1)<<(k-1-b);
    }
    return ret;
}

int query(int ind, int k) {

    if (ind + (1ll<<k) -1 >=n) return false;
    for (int i=ind; i<ind+(1ll<<k); ++i) {
        int j=rev(i-ind,k);
        //if ((j+ind>=S.length()) || (i>>S.length())) return false;
        //cout<<i<<' '<<j+ind<<'\n';
        if (S[i]!=S[j+ind]) return false;
    }
    return true;

}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 27 ms 1620 KB Output is correct
4 Correct 27 ms 1604 KB Output is correct
5 Correct 26 ms 1648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3087 ms 1052 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 27 ms 1620 KB Output is correct
4 Correct 27 ms 1604 KB Output is correct
5 Correct 26 ms 1648 KB Output is correct
6 Execution timed out 3087 ms 1052 KB Time limit exceeded
7 Halted 0 ms 0 KB -