답안 #624874

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
624874 2022-08-08T23:58:08 Z Cyber_Wolf Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
//Contest: APIO 16 Problem 3
//Problem Name: Gap


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")

using namespace std;
using namespace __gnu_pbds;

#define lg long long
#define ordered_set	tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);
#define endl \n
#define lbound(x, y) lower_bound(x.begin(), x.end(), y) 
#define ubound(x, y) upper_bound(x.begin(), x.end(), y) 
#define sortasc(v) sort(v.begin(), v.end())	
#define sortdesc(v) sort(v.rbegin(), v.rend())	
#define custom_array(a,l, r) int _##a[r-l+1]; int*a=_##a-l;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const lg MOD = 1e9+7, N = 2e5+5, M = 1e7+1, SZ = 1e3+1;


lg findGap(lg subtask, lg n)
{
	vector<lg> v;
	lg last = 0;
	while(n--)
	{
		lg mnm, mxm;
		MinMax(last, 1e18, mnm, mxm);
		v.push_back(mnm);
		last = mnm+1;
	}
	lg ans = 0;
	for(int i = 1; i < v.size(); i++)	ans = max(ans, v[i]-v[i-1]);
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:35:3: error: 'MinMax' was not declared in this scope
   35 |   MinMax(last, 1e18, mnm, mxm);
      |   ^~~~~~
gap.cpp:40:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |  for(int i = 1; i < v.size(); i++) ans = max(ans, v[i]-v[i-1]);
      |                 ~~^~~~~~~~~~