Submission #525911

# Submission time Handle Problem Language Result Execution time Memory
525911 2022-02-13T07:38:17 Z Nihal_9936 Secret (JOI14_secret) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#include "secret.h"

int dp[1001][1001];
int n;

void solve(int f, int l, int A[]){
	int mid = (f + l) / 2;
	dp[mid][mid] = A[mid];
	dp[mid + 1][mid + 1] = A[mid + 1];

	for(int i = mid - 1; i >= f; i--){
		dp[mid][i] = Secret(A[i], dp[mid][i + 1]);
	}

	for(int i = mid + 2; i <= l; i++){
		dp[mid + 1][i] = Secret(A[i], dp[mid + 1][i]);
	}

	if(f < mid) solve(f, mid, A);
	if(mid+1 < l) solve(mid + 1, l, A); 
}


void Init(int N, int A[]) {
	// for(int i = 0; i < 1001; i++){
	// 	for(int j = 0; j < 1001; j++){
	// 		dp[i][j] = -1;
	// 	}
	// }
	n = N;
	solve(0, n - 1, A);
}

int Query(int l, int r){
	int f = 0, ls = n - 1;
	while(true){
		int mid = (f + ls) / 2;
		if(l <= mid and mid < r){
			return Secret(dp[mid][l], dp[mid + 1][r]);
		}
		if(r <= mid){
			ls = mid;
		}else{
			f = mid + 1;
		}
	}
}

int main(){

}

Compilation message

/usr/bin/ld: /tmp/ccqRBE4E.o: in function `main':
secret.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccbPUb8B.o:grader-full.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status