# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
438841 |
2021-06-28T17:34:33 Z |
fadi57 |
Secret (JOI14_secret) |
C++14 |
|
659 ms |
4368 KB |
#include "secret.h"
//#include "grader.cpp"
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
const int mx=1030;
typedef long long ll;
const int mod=1e9+7;
int inf=1e9+10;
int arr[mx];
int n;
int seg[4*mx];
int merg(int x,int y){
if(x==-1){return y;}
if(y==-1){return x;}
return Secret(x,y);
}
void solve(int node,int l,int r){
if(l==r){
seg[node]=arr[l];
return ;
}
int mid=(l+r)/2;
solve(node*2,l,mid); solve(node*2+1,mid+1,r);
seg[node]=merg(seg[node*2],seg[node*2+1]);
return;
}
int query (int node,int l,int r,int l2,int r2){
if(l>r2||r<l2){
return -1;
}
if(l>=l2&&r<=r2){
return seg[node];
}
int mid=(l+r)/2;
return merg(query(node*2,l,mid,l2,r2),query(node*2+1,mid+1,r,l2,r2));
}
void Init(int N, int A[]) {
for(int i=0;i<N;i++){
arr[i]=A[i];
}
n=N;
// Secret(0, 1000000000);
solve(1,0,n-1);
}
int Query(int L, int R) {
return query(1,0,n-1,L,R);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
213 ms |
2364 KB |
Output is partially correct - number of calls to Secret by Init = 510, maximum number of calls to Secret by Query = 13 |
2 |
Partially correct |
224 ms |
2376 KB |
Output is partially correct - number of calls to Secret by Init = 511, maximum number of calls to Secret by Query = 14 |
3 |
Partially correct |
209 ms |
2344 KB |
Output is partially correct - number of calls to Secret by Init = 512, maximum number of calls to Secret by Query = 15 |
4 |
Partially correct |
593 ms |
4368 KB |
Output is partially correct - number of calls to Secret by Init = 998, maximum number of calls to Secret by Query = 15 |
5 |
Partially correct |
608 ms |
4224 KB |
Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 15 |
6 |
Partially correct |
536 ms |
4256 KB |
Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 4 |
7 |
Partially correct |
611 ms |
4244 KB |
Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 16 |
8 |
Partially correct |
613 ms |
4264 KB |
Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 16 |
9 |
Partially correct |
605 ms |
4292 KB |
Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 16 |
10 |
Partially correct |
659 ms |
4164 KB |
Output is partially correct - number of calls to Secret by Init = 999, maximum number of calls to Secret by Query = 16 |