#include <bits/stdc++.h>
#include "secret.h"
using namespace std;
/*int Secret(int a, int b) {
return min(a, b);
}*/
const int mxN = 1000, mxK = 10;
int n, a[mxN];
int tl[mxN][mxK], tr[mxN][mxK];
void Init(int N, int A[]) {
n = N;
for (int i = 0; i < n; ++i) {
a[i] = A[i];
}
/*for (int j = 0; (1 << j) <= n; ++j) {
int mask = (1 << j) - 1;
int temp;
for (int i = 0; i < n; ++i) {
temp = ((i & mask) == 0) ? a[i] : Secret(temp, a[i]);
tr[i][j] = temp;
}
for (int i = n - 1; ~i; --i) {
temp = ((i & mask) == mask || i == n - 1) ? a[i] : Secret(a[i], temp);
tl[i][j] = temp;
}
}*/
}
int Query(int L, int R) {
if (L == R) return a[L];
if (R == L + 1) return Secret(a[L], a[R]);
//int x = 31 - __builtin_clz(L ^ R);
//return Secret(tl[L][x], tr[R][x]);
int ans = a[L];
for (int i = L + 1; i <= R; ++i) {
ans = Secret(ans, a[i]);
}
return ans;
}
/*int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a[3] = {2, 1, 3};
Init(3, a);
for (int i = 0; i < 3; ++i) for (int j = i; j < 3; ++j) cout << i << " " << j << " " << Query(i, j) << "\n";
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1784 ms |
2460 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 506 |
2 |
Partially correct |
1757 ms |
2484 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 508 |
3 |
Partially correct |
1798 ms |
2552 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 505 |
4 |
Partially correct |
3758 ms |
4460 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 997 |
5 |
Partially correct |
3787 ms |
4472 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 992 |
6 |
Partially correct |
539 ms |
4380 KB |
Output is partially correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 10 |
7 |
Partially correct |
9349 ms |
4368 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 999 |
8 |
Partially correct |
9139 ms |
4364 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 999 |
9 |
Partially correct |
9034 ms |
4388 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 998 |
10 |
Partially correct |
9022 ms |
4360 KB |
Output isn't correct - number of calls to Secret by Init = 0, maximum number of calls to Secret by Query = 999 |