Submission #63031

# Submission time Handle Problem Language Result Execution time Memory
63031 2018-07-31T11:11:00 Z hamzqq9 popa (BOI18_popa) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "popa.h"
#define st first
#define nd second
#define pb push_back
#define ppb pop_back
#define umax(x,y) x=max(x,y)
#define umin(x,y) x=min(x,y)
#define ll long long
#define ii pair<int,int>
#define iii pair<ii,int>
#define sz(x) (x.size())
#define orta ((bas+son)>>1)
#define all(x) x.begin(),x.end()
#define dbgs(x) cerr<<(#x)<<" --> "<<(x)<<" "
#define dbg(x) cerr<<(#x)<<" --> "<<(x)<<endl;getchar()
#define pw(x) (1<<(x))
#define inf 2000500000
#define MOD 1000000007
//#define N 305
#define LOG 20
using namespace std;

int Solve(int bas,int son,int *Left,int *Right) {

	if(bas==son) {

		Left[bas]=Right[bas]=-1;

		return bas;

	}

	int L=Solve(orta+1,son,Left,Right);
	int R=Solve(bas,orta,Left,Right);
	
	if(query(bas,orta,bas,son)) {

		int tut=L;

		while(1) {

			if(Right[L]==-1) {

				Right[L]=R;

				break ;

			}

			L=Right[L];

		}

	}
	else {

		int tut=R;

		while(1) {

			if(Left[R]==-1) {

				Left[R]=L;

				break ;

			}

			R=Left[R];

		}

	}

	return tut;

}

int solve(int N, int* Left, int* Right) {

	return Solve(0,N-1,Left,Right);

}

Compilation message

popa.cpp: In function 'int Solve(int, int, int*, int*)':
popa.cpp:39:7: warning: unused variable 'tut' [-Wunused-variable]
   int tut=L;
       ^~~
popa.cpp:58:7: warning: unused variable 'tut' [-Wunused-variable]
   int tut=R;
       ^~~
popa.cpp:76:9: error: 'tut' was not declared in this scope
  return tut;
         ^~~