#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << "\n"
#define debug_with_space(x) cerr << #x << " " << x << " "
#include "secret.h"
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
typedef pair <long double, pii> muchie;
const ll NMAX = 300001;
const ll INF = (1LL << 60);
const ll MOD = 998244353;
const ll BLOCK = 225;
const ll base = 31;
const ll nr_of_bits = 21;
int table[1001][1001], n;
void divide(int l, int r){
int mid = (l + r) / 2;
for(int i = mid - 1; i >= l; i--){
table[i][mid] = Secret(table[i + 1][mid], table[i][i]);
}
for(int i = mid + 2; i <= r; i++){
table[mid + 1][i] = Secret(table[mid + 1][i - 1], table[i][i]);
}
divide(l, mid);
divide(mid + 1, r);
}
void Init(int N, int A[]) {
n = N;
for(int i = 0; i < N; i++)
table[i][i] = A[i];
divide(0, N - 1);
}
int q(int st, int dr, int l, int r){
int mid = (st + dr) / 2;
if(l <= mid && mid + 1 <= r){
return Secret(table[l][mid], table[mid + 1][r]);
}
if(r <= mid){
return q(st, mid, l, r);
}
if(l > mid){
return q(mid + 1, dr, l, r);
}
}
int Query(int L, int R) {
return q(0, n - 1, L, R);
}
Compilation message
secret.cpp: In function 'int q(int, int, int, int)':
secret.cpp:50:1: warning: control reaches end of non-void function [-Wreturn-type]
50 | }
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
479 ms |
524292 KB |
Execution killed with signal 9 |
2 |
Runtime error |
390 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Runtime error |
384 ms |
524292 KB |
Execution killed with signal 9 |
4 |
Runtime error |
743 ms |
524292 KB |
Execution killed with signal 9 |
5 |
Runtime error |
743 ms |
524292 KB |
Execution killed with signal 9 |
6 |
Runtime error |
742 ms |
524292 KB |
Execution killed with signal 9 |
7 |
Runtime error |
744 ms |
524292 KB |
Execution killed with signal 9 |
8 |
Runtime error |
764 ms |
524292 KB |
Execution killed with signal 9 |
9 |
Runtime error |
745 ms |
524292 KB |
Execution killed with signal 9 |
10 |
Runtime error |
735 ms |
524292 KB |
Execution killed with signal 9 |