답안 #207489

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
207489 2020-03-07T16:12:01 Z mayhoubsaleh 비밀 (JOI14_secret) C++14
30 / 100
565 ms 4728 KB
#include "secret.h"
#include <bits/stdc++.h>

using namespace std;

int sum[1010][20];
void Init(int n, int a[]) {
    for(int i=0;i<n;i++){
        sum[i][0]=a[i];
    }

    for(int i=1;i<10;i++){
        for(int id=0;id<n&&id+(1<<i)<=n;id++){
            sum[id][i]=Secret(sum[id][i-1],sum[id+(1<<(i-1))][i-1]);
        }
    }
}

int Query(int l, int r) {
    int len=(r-l+1);
    int ret=-1;
    for(int i=0;i<10;i++){
        if(((1<<i)&len)==0)continue;
        if(ret==-1)ret=sum[l][i];
        else ret=Secret(ret,sum[l][i]);
        l+=(1<<i);
    }
    return ret;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 169 ms 2556 KB Output is partially correct - number of calls to Secret by Init = 3586, maximum number of calls to Secret by Query = 7
2 Partially correct 171 ms 2552 KB Output is partially correct - number of calls to Secret by Init = 3595, maximum number of calls to Secret by Query = 7
3 Partially correct 171 ms 2552 KB Output is partially correct - number of calls to Secret by Init = 3604, maximum number of calls to Secret by Query = 7
4 Partially correct 546 ms 4472 KB Output is partially correct - number of calls to Secret by Init = 7978, maximum number of calls to Secret by Query = 8
5 Partially correct 541 ms 4600 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 8
6 Partially correct 518 ms 4472 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 2
7 Partially correct 556 ms 4472 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 8
8 Partially correct 564 ms 4728 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 7
9 Partially correct 565 ms 4576 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 8
10 Partially correct 554 ms 4472 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 7