Submission #68598

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
685982018-08-17 13:12:54aomepopa (BOI18_popa)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
// int a[N], L[N], R[N];
int par[N];
// int get(int l, int r) {
// int gcd = 0;
// for (int i = l; i <= r; ++i) gcd = __gcd(gcd, a[i]);
// return gcd;
// }
// int query(int a, int b, int c, int d) {
// return get(a, b) == get(c, d);
// }
int solve(int n, int* L, int* R) {
memset(par, -1, sizeof par);
L[0] = R[0] = -1;
for (int i = 1; i < n; ++i) {
int cur = i - 1;
L[i] = R[i] = -1;
while (1) {
if (query(cur, i, i, i)) {
if (par[cur] == -1) {
par[cur] = i, L[i] = cur; break;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:27:8: error: 'query' was not declared in this scope
    if (query(cur, i, i, i)) {
        ^~~~~
popa.cpp:40:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^