# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
949570 |
2024-03-19T11:14:17 Z |
JakobZorz |
Secret (JOI14_secret) |
C++17 |
|
362 ms |
15888 KB |
#include "secret.h"
int n;
int arr[1024];
int tl[2048][1024];
int tr[2048][1024];
void init(int node,int l,int r){
if(l==r-1)
return;
int m=(l+r)/2;
/*if(m>1000)
return;*/
tl[node][m-1]=arr[m-1];
for(int i=m-2;i>=l;i--)
tl[node][i]=Secret(arr[i],tl[node][i+1]);
tr[node][m+1]=arr[m];
for(int i=m+2;i<=r/*&&i<=1000*/;i++)
tr[node][i]=Secret(tr[node][i-1],arr[i-1]);
init(2*node,l,m);
init(2*node+1,m,r);
}
void Init(int N,int A[]){
n=N;
for(int i=0;i<n;i++)
arr[i]=A[i];
init(1,0,1024);
}
int query(int node,int l,int r,int a,int b){
int m=(l+r)/2;
if(b<m)
return query(2*node,l,m,a,b);
if(m<a)
return query(2*node+1,m,r,a,b);
if(a==m)
return tr[node][b];
if(b==m)
return tl[node][a];
return Secret(tl[node][a],tr[node][b]);
}
int Query(int L,int R){
return query(1,0,1024,L,R+1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
105 ms |
15696 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
2 |
Partially correct |
112 ms |
15696 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
3 |
Partially correct |
104 ms |
15852 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
4 |
Partially correct |
356 ms |
15700 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
5 |
Partially correct |
362 ms |
15888 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
6 |
Partially correct |
358 ms |
15696 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
7 |
Partially correct |
358 ms |
15676 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
8 |
Partially correct |
358 ms |
15872 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
9 |
Partially correct |
358 ms |
15880 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |
10 |
Partially correct |
359 ms |
15888 KB |
Output isn't correct - number of calls to Secret by Init = 8194, maximum number of calls to Secret by Query = 1 |