# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
70275 |
2018-08-22T14:33:47 Z |
MladenP |
Secret (JOI14_secret) |
C++17 |
|
686 ms |
8612 KB |
#include <bits/stdc++.h>
#include "secret.h"
#define mid (l+r)/2
using namespace std;
int n, i, a[1010], d[1010][1010];
void init(int l, int r) {
if(l >= r) return;
for(i = mid+1; i <= r; i++) d[mid][i] = Secret(d[mid][i-1], a[i]);
for(i = mid-2; i >= l; i--) d[i][mid-1] = Secret(a[i], d[i+1][mid-1]);
init(l, mid);init(mid+1, r);
}
void Init(int N, int *A) {
for(i = 0, n = N; i < n; i++) a[i] = A[i], d[i][i] = a[i];
init(0, N-1);
}
int query(int l, int r, int L, int R) {
if(L < mid && mid <= R) return Secret(d[L][mid-1],d[mid][R]);
if(L == mid) return d[mid][R];
if(mid < L) return query(mid+1, r, L, R);
return query(l, mid, L, R);
}
int Query(int L, int R) {
if(L == R) return a[L];
return query(0, n-1, L, R);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
202 ms |
4472 KB |
Output is correct - number of calls to Secret by Init = 3833, maximum number of calls to Secret by Query = 1 |
2 |
Correct |
200 ms |
4472 KB |
Output is correct - number of calls to Secret by Init = 3842, maximum number of calls to Secret by Query = 1 |
3 |
Correct |
187 ms |
4616 KB |
Output is correct - number of calls to Secret by Init = 3851, maximum number of calls to Secret by Query = 1 |
4 |
Incorrect |
680 ms |
8488 KB |
Output isn't correct - number of calls to Secret by Init = 8456, maximum number of calls to Secret by Query = 1 |
5 |
Incorrect |
653 ms |
8580 KB |
Output isn't correct - number of calls to Secret by Init = 8466, maximum number of calls to Secret by Query = 1 |
6 |
Incorrect |
686 ms |
8580 KB |
Output isn't correct - number of calls to Secret by Init = 8466, maximum number of calls to Secret by Query = 1 |
7 |
Incorrect |
677 ms |
8580 KB |
Output isn't correct - number of calls to Secret by Init = 8466, maximum number of calls to Secret by Query = 1 |
8 |
Incorrect |
668 ms |
8580 KB |
Output isn't correct - number of calls to Secret by Init = 8466, maximum number of calls to Secret by Query = 1 |
9 |
Incorrect |
638 ms |
8612 KB |
Output isn't correct - number of calls to Secret by Init = 8466, maximum number of calls to Secret by Query = 1 |
10 |
Incorrect |
621 ms |
8612 KB |
Output isn't correct - number of calls to Secret by Init = 8466, maximum number of calls to Secret by Query = 1 |