# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
740280 |
2023-05-12T09:22:59 Z |
BidoTeima |
Secret (JOI14_secret) |
C++17 |
|
468 ms |
8276 KB |
#include "secret.h"
#include <bits/stdc++.h>
const int N = 1e3;
int val[N][N];
int a[N];
void rec(int l, int r){
if(l == r){
val[l][l] = a[l];
return;
}
int mid = (l + r) >> 1;
// (l, mid), (l + 1, mid), ..., (mid, mid)
int pre = a[l];
for(int i = l; i <= mid; i++){
if(i > l)pre = Secret(pre, a[i]);
val[l][i] = pre;
}
pre = a[mid + 1];
for(int i = mid + 1; i <= r; i++){
if(i > mid + 1)pre = Secret(pre, a[i]);
val[mid + 1][i] = pre;
}
rec(l, mid);
rec(mid + 1, r);
}
void Init(int n, int A[]) {
for(int i = 0; i < n; i++){
a[i] = A[i];
}
memset(val, -1, sizeof(val));
rec(0, n - 1);
}
int Query(int L, int R) {
if(L == R)
return val[L][L];
for(int i = L; i <= R; i++){
if(val[L][i] != -1 && val[i + 1][R] != -1)
return Secret(val[L][i], val[i + 1][R]);
}
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
166 ms |
6224 KB |
Wrong Answer: Query(113, 206) - expected : 536899947, actual : -1. |
2 |
Incorrect |
118 ms |
6200 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : -1. |
3 |
Incorrect |
123 ms |
6200 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : -1. |
4 |
Incorrect |
427 ms |
8088 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : -1. |
5 |
Incorrect |
441 ms |
8160 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : -1. |
6 |
Incorrect |
462 ms |
8088 KB |
Wrong Answer: Query(811, 813) - expected : 25091616, actual : -1. |
7 |
Incorrect |
459 ms |
8120 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : -1. |
8 |
Incorrect |
468 ms |
8276 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : -1. |
9 |
Incorrect |
446 ms |
8256 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : -1. |
10 |
Incorrect |
452 ms |
8204 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : -1. |