Submission #63027

# Submission time Handle Problem Language Result Execution time Memory
63027 2018-07-31T10:55:26 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 x,int y,int *Left,int *Right) {

	if(x>y) return -1;

	int bas=x,son=y;
	
	while(bas<=son) {

		if(query(x,y)==query(bas,orta)) son=orta-1;
		else bas=orta+1;

	}

	Left[bas]=Solve(x,bas-1);
	Right[bas]=Solve(bas+1,y);

	return bas;

}

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:32:15: error: too few arguments to function 'int query(int, int, int, int)'
   if(query(x,y)==query(bas,orta)) son=orta-1;
               ^
In file included from popa.cpp:2:0:
popa.h:4:5: note: declared here
 int query(int a, int b, int c, int d);
     ^~~~~
popa.cpp:32:32: error: too few arguments to function 'int query(int, int, int, int)'
   if(query(x,y)==query(bas,orta)) son=orta-1;
                                ^
In file included from popa.cpp:2:0:
popa.h:4:5: note: declared here
 int query(int a, int b, int c, int d);
     ^~~~~
popa.cpp:37:25: error: too few arguments to function 'int Solve(int, int, int*, int*)'
  Left[bas]=Solve(x,bas-1);
                         ^
popa.cpp:24:5: note: declared here
 int Solve(int x,int y,int *Left,int *Right) {
     ^~~~~
popa.cpp:38:26: error: too few arguments to function 'int Solve(int, int, int*, int*)'
  Right[bas]=Solve(bas+1,y);
                          ^
popa.cpp:24:5: note: declared here
 int Solve(int x,int y,int *Left,int *Right) {
     ^~~~~
popa.cpp: At global scope:
popa.cpp:20:11: error: expected ',' or '...' before numeric constant
 #define N 305
           ^
popa.cpp:44:15: note: in expansion of macro 'N'
 int solve(int N, int* Left, int* Right) {
               ^
popa.cpp: In function 'int solve(int)':
popa.cpp:46:21: error: 'Left' was not declared in this scope
  return Solve(0,N-1,Left,Right);
                     ^~~~
popa.cpp:46:26: error: 'Right' was not declared in this scope
  return Solve(0,N-1,Left,Right);
                          ^~~~~
popa.cpp:46:26: note: suggested alternative: 'sig_t'
  return Solve(0,N-1,Left,Right);
                          ^~~~~
                          sig_t