# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
70283 | Pajaraja | Secret (JOI14_secret) | C++17 | 656 ms | 8560 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "secret.h"
#define g return
#define q int
q i,v[1007][1007],*a,n,s;void t(q l,q r){s=(l+r)/2;for(i=s;i>l;i--)v[i-1][s]=Secret(a[i-1],v[i][s]);for(i=s+2;i<=r;i++)v[s+1][i]=Secret(v[s+1][i-1],a[i]);if(l==r)g;t(l,s);t(s+1,r);}void Init(q N,q*A){for(i=0;i<N;i++)v[i][i]=A[i];a=A;t(0,n=--N);}q b(q l,q r,q o,q u){if(l==r)g a[l];s=(l+r)/2;if(o<=s&&u>s)g Secret(v[o][s],v[s+1][u]);if(u<=s)g b(l,s,o,u);g b(s+1,r,o,u);}q Query(q L,q R){g b(0,n,L,R);}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |