Submission #763252

# Submission time Handle Problem Language Result Execution time Memory
763252 2023-06-22T07:14:25 Z CESxRhino Xylophone (JOI18_xylophone) C++14
Compilation error
0 ms 0 KB
#include "xylophone.h"
#include <bits/stdc++.h>
using namespace std;
int re[200005];
int a[200005];
int b[200005];
void solve(int N)
{
	for(int i = 1;i <= N - 1;i++)
	{
		a[i] = query(i,i + 1);
	}
	for(int i = 1;i <= N - 2;i++)
	{
		b[i] = query(i,i + 2);
	}
	re[1] = 1;
	for(int i = 1;i <= N - 2;i++)
	{
		if(a[i] + a[i + 1] == b[i])
		{
			re[i + 1] = re[i];
		}
		else
		{
			re[i + 1] = -re[i];
		}
	}
	a[N] = 0;
	int Min = 0;
	for(int i = N - 1;i >= 1;i--)
	{
		a[i] = a[i + 1] - re[i] * a[i];
		Min = min(Min,a[i]);
	}
	for(int i = 1;i <= N;i++)
	{
		a[i] = a[i] - Min + 1;
	}
	for(int i = 1;i <= N;i++)
	{
		if(a[i] == 1)
		{
			brebk;
		}
		if(a[i] == N)
		{
			for(int j = 1;j <= N;j++)
			{
				a[j] = N + 1 - a[j];
			}
		}
	}
	for(int i = 1;i <= N;i++)
	{
		answer(i,a[i]);
	}
	cout << endl;
}

Compilation message

xylophone.cpp: In function 'void solve(int)':
xylophone.cpp:44:4: error: 'brebk' was not declared in this scope
   44 |    brebk;
      |    ^~~~~