Submission #293330

# Submission time Handle Problem Language Result Execution time Memory
293330 2020-09-07T21:55:20 Z phillip Secret (JOI14_secret) C++14
0 / 100
502 ms 8824 KB
#include "secret.h"
#include <bits/stdc++.h>
#define ll long long
#define fast cin.tie(0);cout.tie(0);
#define order ios::sync_with_stdio(0);ios_base::sync_with_stdio(0);
#define pb push_back
#define ln 2*x+1
#define rn 2*x+2
#define m (l+r)/2
using namespace std;
int a[1009],seg[4009],n;
void bld(int x,int l,int r)
{
    if(l==r)
    {
        seg[x]=a[l];
        return;
    }
    bld(ln,l,m);
    bld(rn,+1,r);
    seg[x]=Secret(seg[ln],seg[rn]);
}
void Init(int N, int A[])
{
    n=N;
    for(int i=0;i<n;i++)a[i]=A[i];
    bld(0,0,N-1);
}
int qu(int x,int l,int r,int b,int e)
{
    if(b<=l&&r<=e)return seg[x];
    if(m>=b&&m<e)return Secret(qu(ln,l,m,b,e),qu(rn,m+1,r,b,e));
    else if(m<e)return qu(rn,m+1,r,b,e);
    else return qu(ln,l,m,b,e);
}
int Query(int L, int R)
{
    return qu(0,0,n-1,L,R);
}
# Verdict Execution time Memory Grader output
1 Runtime error 135 ms 4728 KB Execution killed with signal 11
2 Runtime error 134 ms 4856 KB Execution killed with signal 11
3 Runtime error 135 ms 4856 KB Execution killed with signal 11
4 Runtime error 494 ms 8780 KB Execution killed with signal 11
5 Runtime error 491 ms 8824 KB Execution killed with signal 11
6 Runtime error 495 ms 8568 KB Execution killed with signal 11
7 Runtime error 499 ms 8760 KB Execution killed with signal 11
8 Runtime error 502 ms 8744 KB Execution killed with signal 11
9 Runtime error 493 ms 8676 KB Execution killed with signal 11
10 Runtime error 494 ms 8696 KB Execution killed with signal 11