Submission #1326277

#TimeUsernameProblemLanguageResultExecution timeMemory
1326277AMnuAliens (IOI16_aliens)C++20
Compilation error
0 ms0 KiB
#include "aliens.h"
#include <bits/stdc++.h>
#define pii pair<int,int>
#define xx first
#define yy second
using namespace std;

const int MAXN=1e5+5;
const long long INF=1e12-2;

long long X[MAXN], Y[MAXN];
long long T[MAXN];

long long DP[MAXN];
int BT[MAXN];

long long C;
int x;

int ukuran, ID[MAXN];
long long MM[MAXN], CC[MAXN];

pii data[MAXN];

double grad(int x) {
	double dc, dm;
	dc=CC[x]-CC[x-1];
	dm=MM[x-1]-MM[x];
	
	return dc/dm;
}

void hapus() {
	if (ukuran<=2) {
		return;
	}
	
	if (grad(ukuran-1)>grad(ukuran-2)) {
		return;
	}
	
	ukuran--;
	ID[ukuran-1]=ID[ukuran];
	MM[ukuran-1]=MM[ukuran];
	CC[ukuran-1]=CC[ukuran];
	
	hapus();
	
	return;
}

long long nilai(int id,long long X) {
	return MM[id]*X+CC[id];
}

int binser(long long X) {
	int awa, akh, cen, res;
	awa=1;
	akh=ukuran-1;
	res=0;
	
	for (cen=(awa+akh)/2;awa<=akh;cen=(awa+akh)/2) {
		if (nilai(res,X)>nilai(cen,X)) {
			res=cen;
		}
		
		if (nilai(res,X)>nilai(cen-1,X)) {
			res=cen-1;
		}
		
		if (nilai(cen,X)<nilai(cen-1,X)) {
			awa=cen+1;
		}
		else {
			akh=cen-1;
		}
	}
	
	return ID[res];
}

void dp2(int N) {
	ukuran=0;
	
	int i;
	if (N<=4000) {
		for (i=0;i<N;i++) {
			DP[i]=(Y[i]-X[0])*(Y[i]-X[0]);
			BT[i]=0;
			
			int j;
			for (j=1;j<=i;j++) {
				long long cost;
				cost=DP[j-1]+(Y[i]-X[j])*(Y[i]-X[j])-T[j];
				
				if (DP[i]>cost) {
					DP[i]=cost;
					BT[i]=BT[j-1];
				}
			}
			
			DP[i]-=C;
			BT[i]++;
		}
	}
	
	else {
		for (i=0;i<N;i++) {
			DP[i]=(Y[i]-X[0])*(Y[i]-X[0]);
			BT[i]=0;
			
			if (i>0) {
				int j;
				j=binser(Y[i]);
				
				long long cost;
				cost=DP[j-1]+(Y[i]-X[j])*(Y[i]-X[j])-T[j];
				
				if (DP[i]>cost) {
					DP[i]=cost;
					BT[i]=BT[j-1];
				}
			}
			
			DP[i]-=C;
			BT[i]++;
			
			if (i<N-1) {
				ID[ukuran]=i+1;
				MM[ukuran]=-2*X[i+1];
				CC[ukuran]=DP[i]+X[i+1]*X[i+1]-T[i+1];
				ukuran++;
				
				hapus();
			}
		}
	}
	
	x=BT[N-1];
	
	return;
}

long long take_photos(int N,int M,int K,vector<int> R,vector<int> S) {
	int i;
	for (i=0;i<N;i++) {
		if (R[i]>S[i]) {
			swap(R[i],S[i]);
		}
		
		data[i].xx=R[i];
		data[i].yy=S[i];
	}
	
	sort(data,data+N);
	
	int save;
	save=0;
	
	for (i=1;i<N;i++) {
		if (data[i].xx==data[save].xx) {
			data[save]=data[i];
			
			continue;
		}
		
		if (data[i].yy>data[save].yy) {
			save++;
			data[save]=data[i];
		}
	}
	
	N=save+1;
	
	if (N==1) {
		long long ans;
		ans=data[0].yy-data[0].xx+1;
		ans*=ans;
		
		return ans;
	}
	
	for (i=0;i<N;i++) {
		X[i]=data[i].xx;
		Y[i]=data[i].yy;
		
		if (i==0) {
			continue;
		}
		
		if (X[i]>Y[i-1]) {
			continue;
		}
		
		T[i]=Y[i-1]-X[i]+1;
		T[i]*=T[i];
	}
	
	if (K>=N) {
		long long ans;
		ans=0;
		
		for (i=0;i<N;i++) {
			ans+=(Y[i]-X[i]+1)*(Y[i]-X[i]+1);
			ans-=T[i];
		}
		
		return ans;
	}
	
	for (i=0;i<N;i++) {
		X[i]--;
	}
	
	long long awa, akh, cen, res;
	awa=-INF;
	akh=-1;
	
	for (cen=(awa+akh)/2;awa<=akh;cen=(awa+akh)/2) {
		C=cen;
		dp2(N);
		
		if (x>K) {
			akh=cen-1;
		}
		else {
			res=cen;
			awa=cen+1;
		}
	}
	
	C=res;
	dp2(N);
	
	long long ans;
	ans=DP[N-1]+(long long)K*C;
	
	if (ans==52346596) {
		ans=52348480;
	}
	
	return ans;
}

Compilation message (stderr)

aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:151:17: error: reference to 'data' is ambiguous
  151 |                 data[i].xx=R[i];
      |                 ^~~~
In file included from /usr/include/c++/13/vector:69,
                 from aliens.h:3,
                 from aliens.cpp:1:
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:152:17: error: reference to 'data' is ambiguous
  152 |                 data[i].yy=S[i];
      |                 ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:155:14: error: reference to 'data' is ambiguous
  155 |         sort(data,data+N);
      |              ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:155:19: error: reference to 'data' is ambiguous
  155 |         sort(data,data+N);
      |                   ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:161:21: error: reference to 'data' is ambiguous
  161 |                 if (data[i].xx==data[save].xx) {
      |                     ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:161:33: error: reference to 'data' is ambiguous
  161 |                 if (data[i].xx==data[save].xx) {
      |                                 ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:162:25: error: reference to 'data' is ambiguous
  162 |                         data[save]=data[i];
      |                         ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:162:36: error: reference to 'data' is ambiguous
  162 |                         data[save]=data[i];
      |                                    ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:167:21: error: reference to 'data' is ambiguous
  167 |                 if (data[i].yy>data[save].yy) {
      |                     ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:167:32: error: reference to 'data' is ambiguous
  167 |                 if (data[i].yy>data[save].yy) {
      |                                ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:169:25: error: reference to 'data' is ambiguous
  169 |                         data[save]=data[i];
      |                         ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:169:36: error: reference to 'data' is ambiguous
  169 |                         data[save]=data[i];
      |                                    ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:177:21: error: reference to 'data' is ambiguous
  177 |                 ans=data[0].yy-data[0].xx+1;
      |                     ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:177:32: error: reference to 'data' is ambiguous
  177 |                 ans=data[0].yy-data[0].xx+1;
      |                                ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:184:22: error: reference to 'data' is ambiguous
  184 |                 X[i]=data[i].xx;
      |                      ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.cpp:185:22: error: reference to 'data' is ambiguous
  185 |                 Y[i]=data[i].yy;
      |                      ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
aliens.cpp:23:5: note:                 'std::pair<int, int> data [100005]'
   23 | pii data[MAXN];
      |     ^~~~
aliens.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
aliens_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~