제출 #1175224

#제출 시각아이디문제언어결과실행 시간메모리
1175224raspyGap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
#include "gap.h"
#include <bits/stdc++.h>

#define int long long

using namespace std;

const int inf = 1e18;

long long findGap(int32_t t, int32_t n)
{
	int mn, mx;
	MinMax(0, inf, &mn, &mx);
	int ds = mx-mn;
	int kor = (ds+n-1)/(n-1);
	int pr = mn, rez = 0;
	for (int i = mn; i <= mx; i+=x)
	{
		MinMax(i, i+x, &tr, &mx);
		if (tr == -1) continue;
		rez = max(rez, pr-tr);
		pr = tr;
	}
	return rez;
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int32_t, int32_t)':
gap.cpp:17:38: error: 'x' was not declared in this scope
   17 |         for (int i = mn; i <= mx; i+=x)
      |                                      ^
gap.cpp:19:33: error: 'tr' was not declared in this scope; did you mean 'pr'?
   19 |                 MinMax(i, i+x, &tr, &mx);
      |                                 ^~
      |                                 pr