Submission #166526

#TimeUsernameProblemLanguageResultExecution timeMemory
166526losmi247Secret (JOI14_secret)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "secret.h" using namespace std; typedef long long ll; typedef pair <int,int> p; const int N = 1005; int n,a[N]; int x[N][N]; void nesto(int l,int r){ int mid = l+(r-l)/2; if(mid >= r || mid < l){ return; } x[mid][mid] = a[mid]; x[mid+1][mid+1] = a[mid+1]; for(int i = mid-1; i >= l; i--){ x[i][mid] = Secret(a[i],x[i+1][mid]); } for(int i = mid+2; i <= r; i++){ x[mid+1][i] = Secret(x[mid+1][i-1],a[i]); } nesto(l,mid); nesto(mid+1,r); } int Query(int l,int r){ if(l == r){ return a[l]; } if(l+1 == r){ return Secret(a[l],a[r]); } for(int i = l i < r; i++){ if(x[l][i] != -1 && x[i+1][r] != -1){ return Secret(x[l][i],x[i+1][r]); } } } void Init(int l,int d[]){ n = l; for(int i = 1; i <= n; i++){ a[i] = d[i-1]; } for(int i = 1; i <= n; i++){ for(int j = 1; j <= n; j++){ x[i][j] = -1; } } nesto(1,n); }

Compilation message (stderr)

secret.cpp: In function 'int Query(int, int)':
secret.cpp:35:19: error: expected ';' before 'i'
     for(int i = l i < r; i++){
                   ^
secret.cpp:40:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^