Submission #503992

# Submission time Handle Problem Language Result Execution time Memory
503992 2022-01-09T12:36:28 Z Abrar_Al_Samit Secret (JOI14_secret) C++17
30 / 100
487 ms 4388 KB
#include "secret.h"
#include <iostream>
using namespace std;

int sp[1000][11];
void Init(int N, int A[]) {
  for(int i=0; i<N; ++i) {
    sp[i][0] = A[i];
  }
  for(int j=1; j<11; ++j) {
    for(int i=0; i+(1<<j)-1<N; ++i) {
      sp[i][j] = Secret(sp[i][j-1], sp[i+(1<<(j-1))][j-1]);
    }
  }
}

int Query(int L, int R) {
  int ret = sp[L][0];
  if(L==R) return ret;
  ++L;
  int len = R-L+1;
  int id = L;
  for(int j=0; j<11; ++j) if(len>>j&1) {
    ret = Secret(ret, sp[id][j]);
    id += 1<<j;
  }
  return ret;
}
# Verdict Execution time Memory Grader output
1 Partially correct 154 ms 2432 KB Output is partially correct - number of calls to Secret by Init = 3586, maximum number of calls to Secret by Query = 8
2 Partially correct 147 ms 2336 KB Output is partially correct - number of calls to Secret by Init = 3595, maximum number of calls to Secret by Query = 8
3 Partially correct 170 ms 2360 KB Output is partially correct - number of calls to Secret by Init = 3604, maximum number of calls to Secret by Query = 8
4 Partially correct 460 ms 4236 KB Output is partially correct - number of calls to Secret by Init = 7978, maximum number of calls to Secret by Query = 9
5 Partially correct 459 ms 4388 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9
6 Partially correct 437 ms 4280 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 3
7 Partially correct 482 ms 4304 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9
8 Partially correct 484 ms 4244 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9
9 Partially correct 468 ms 4248 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 487 ms 4316 KB Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9