Submission #293196

# Submission time Handle Problem Language Result Execution time Memory
293196 2020-09-07T18:11:05 Z fucking_do_it Secret (JOI14_secret) C++14
0 / 100
539 ms 8824 KB
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e3+9,lg = 12;
int n,cnt = 0;
int a[inf],Log2[inf],sparse[lg][inf];
vector<int> tmp;

void Init(int N, int A[]) {
    n = N;
    Log2[1] = 0;
    for(int i=2;i<=n;i++)
        Log2[i] = Log2[i/2] + 1;
    for(int i=1;i<=n;i++)
        a[i] = A[i-1],sparse[0][i] = a[i];

    for(int j=1;j<lg;j++)
        for(int i=1;i+(1<<j)-1<=n;i++)
            sparse[j][i] = Secret( sparse[j-1][i],sparse[j-1][ i+(1<<(j-1)) ] ),cnt++;
    assert(cnt<=1000);

}

int Query(int L, int R) {

    L++,R++;
    int len = R-L+1;
    int k = Log2[len];
    return Secret( sparse[k][L] , sparse[k][R-(1<<k)+1] );
}
# Verdict Execution time Memory Grader output
1 Runtime error 143 ms 4796 KB Execution killed with signal 11
2 Runtime error 141 ms 4728 KB Execution killed with signal 11
3 Runtime error 142 ms 4728 KB Execution killed with signal 11
4 Runtime error 539 ms 8824 KB Execution killed with signal 11
5 Runtime error 521 ms 8824 KB Execution killed with signal 11
6 Runtime error 520 ms 8696 KB Execution killed with signal 11
7 Runtime error 526 ms 8696 KB Execution killed with signal 11
8 Runtime error 518 ms 8696 KB Execution killed with signal 11
9 Runtime error 524 ms 8760 KB Execution killed with signal 11
10 Runtime error 531 ms 8824 KB Execution killed with signal 11