#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 len = R-L+1;
int id = L;
int ret = 0;
for(int j=0; j<11; ++j) if(len>>j&1) {
ret = Secret(ret, sp[id][j]);
id += 1<<j;
}
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
115 ms |
2372 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 34031537. |
2 |
Incorrect |
118 ms |
2276 KB |
Wrong Answer: Query(102, 157) - expected : 32612619, actual : 569483529. |
3 |
Incorrect |
115 ms |
2400 KB |
Wrong Answer: Query(67, 224) - expected : 202440844, actual : 739311628. |
4 |
Incorrect |
433 ms |
4296 KB |
Wrong Answer: Query(727, 872) - expected : 870334875, actual : 870334619. |
5 |
Incorrect |
424 ms |
4308 KB |
Wrong Answer: Query(761, 790) - expected : 112945480, actual : 112871752. |
6 |
Incorrect |
461 ms |
4260 KB |
Wrong Answer: Query(915, 915) - expected : 282904741, actual : 278446241. |
7 |
Partially correct |
491 ms |
4328 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 |
499 ms |
4308 KB |
Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 8 |
9 |
Partially correct |
522 ms |
4308 KB |
Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 9 |
10 |
Partially correct |
477 ms |
4328 KB |
Output is partially correct - number of calls to Secret by Init = 7987, maximum number of calls to Secret by Query = 8 |