답안 #597034

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
597034 2022-07-15T12:08:07 Z Hacv16 Brperm (RMI20_brperm) C++17
13 / 100
737 ms 262144 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][LOG];
 
map<pii, string> memo;

int query(int I, int K){
    if(I + (1 << K) > sz(s)) return 0;
    return s.substr(I, (1 << K)) == ans[I][K];
}

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++){
            for(int k = 0; k < min(sz(ans[i][j - 1]), sz(ans[i + (1 << (j - 1))][j - 1])); k++){
                ans[i][j] += ans[i][j - 1][k];
                ans[i][j] += ans[i + (1 << (j - 1))][j - 1][k];
            }
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 57976 KB Output is correct
2 Correct 31 ms 57864 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 57976 KB Output is correct
2 Correct 31 ms 57864 KB Output is correct
3 Runtime error 737 ms 262144 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 71 ms 116164 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 57976 KB Output is correct
2 Correct 31 ms 57864 KB Output is correct
3 Runtime error 737 ms 262144 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -