Submission #6980

# Submission time Handle Problem Language Result Execution time Memory
6980 2014-07-12T03:26:18 Z tncks0121 Secret (JOI14_secret) C++
30 / 100
686 ms 5148 KB
#include "secret.h"

int precalc[10][1000];

void Init (int N, int A[]) { 
 for(int i = 0; i < N; i++) precalc[0][i] = A[i];
 for(int k = 1; (1<<k) < N; k++) {
  for(int i = 0; i <= N - (1<<k); i++) precalc[k][i] = Secret(precalc[k-1][i], precalc[k-1][i + (1<<(k-1))]);
 }
}

int Query(int L, int R) {
 int len = (R - L + 1);
 int ret = -1;
 for(int k = 0; k < 10; k++) if((len >> k) & 1) {
  if(ret < 0) ret = precalc[k][L];
  else ret = Secret(ret, precalc[k][L]);
  L += 1<<k;
 }
 return ret;
}

Compilation message


# Verdict Execution time Memory Grader output
1 Partially correct 206 ms 5148 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 206 ms 5148 KB Output is partially correct - number of calls to Secret by Init = 3594, maximum number of calls to Secret by Query = 7
3 Partially correct 203 ms 5148 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 656 ms 5148 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 659 ms 5148 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 606 ms 5148 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 683 ms 5148 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 686 ms 5148 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 663 ms 5148 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 663 ms 5148 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 7