Submission #852586

# Submission time Handle Problem Language Result Execution time Memory
852586 2023-09-22T06:58:35 Z sleepntsheep Secret (JOI14_secret) C++17
30 / 100
404 ms 4428 KB
#include "secret.h"

#define N 1005

int n, *a, st[10][N];

void Init(int n_, int *a_)
{
    n = n_; a = a_;

    for (int i = 0; i < n; ++i) st[0][i] = a[i];

    for (int h = 1; (1 << h) <= n; ++h)
    {
        for (int j = 0; j < n; ++j)
        {
            if (j + (1 << h) > n) continue;
            st[h][j] = Secret(st[h-1][j], st[h-1][j+(1<<(h-1))]);
        }
    }
}

int Query(int l, int r)
{
    int z = a[l++];
    for (int h = 10; h >= 0; --h)
    {
        if ((1 << h) <= r-l+1)
        {
            z = Secret(z, st[h][l]);
            l += 1 << h;
        }
    }
    return z;
}
# Verdict Execution time Memory Grader output
1 Partially correct 125 ms 3664 KB Output is partially correct - number of calls to Secret by Init = 3586, maximum number of calls to Secret by Query = 8
2 Partially correct 136 ms 3652 KB Output is partially correct - number of calls to Secret by Init = 3595, maximum number of calls to Secret by Query = 8
3 Partially correct 124 ms 3680 KB Output is partially correct - number of calls to Secret by Init = 3604, maximum number of calls to Secret by Query = 8
4 Partially correct 384 ms 4288 KB Output is partially correct - number of calls to Secret by Init = 7978, maximum number of calls to Secret by Query = 9
5 Partially correct 384 ms 4428 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9
6 Partially correct 360 ms 4368 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 3
7 Partially correct 404 ms 4348 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9
8 Partially correct 394 ms 4260 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9
9 Partially correct 396 ms 4184 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 8
10 Partially correct 398 ms 4304 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9